source: src/main/java/weka/classifiers/misc/monotone/NominalLossFunction.java @ 19

Last change on this file since 19 was 4, checked in by gnappo, 14 years ago

Import di weka.

File size: 2.0 KB
Line 
1/*
2 *    This program is free software; you can redistribute it and/or modify
3 *    it under the terms of the GNU General Public License as published by
4 *    the Free Software Foundation; either version 2 of the License, or
5 *    (at your option) any later version.
6 *
7 *    This program is distributed in the hope that it will be useful,
8 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
9 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 *    GNU General Public License for more details.
11 *
12 *    You should have received a copy of the GNU General Public License
13 *    along with this program; if not, write to the Free Software
14 *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
15 */
16
17/*
18 *    NominalLossFunction.java
19 *    Copyright (C) 2004 Stijn Lievens
20 *
21 */
22
23package weka.classifiers.misc.monotone;
24
25/**
26 * Interface for incorporating different loss functions.
27 * <p>
28 * This interface contains only one method, namely <code> loss
29 * </code> that measures the error between an actual class
30 * value <code> actual </code> and a predicted value <code>
31 * predicted. </code>  It is understood that the return value
32 * of this method is always be positive and that it is zero
33 * if and only if the actual and the predicted value coincide.
34 * </p>
35 * <p>
36 * This implementation is done as part of the master's thesis: "Studie
37 * en implementatie van instantie-gebaseerde algoritmen voor gesuperviseerd
38 * rangschikken", Stijn Lievens, Ghent University, 2004.
39 * </p>
40 *
41 * @author Stijn Lievens (stijn.lievens@ugent.be)
42 * @version $Revision: 5922 $
43 */
44public interface NominalLossFunction {
45
46  /**
47   * Calculate the loss between an actual and a predicted class value.
48   *
49   * @param actual the actual class value
50   * @param predicted the predicted class value
51   * @return a measure for the error of making the prediction
52   * <code> predicted </code> instead of <code> actual </code>
53   */
54  public double loss(double actual, double predicted);
55}
Note: See TracBrowser for help on using the repository browser.