weka.classifiers.misc.monotone
Class ZeroOneLossFunction
java.lang.Object
weka.classifiers.misc.monotone.ZeroOneLossFunction
- All Implemented Interfaces:
- NominalLossFunction
public class ZeroOneLossFunction
- extends java.lang.Object
- implements NominalLossFunction
Class implementing the zero-one loss function, this is
an incorrect prediction always accounts for one unit loss.
This implementation is done as part of the master's thesis: "Studie
en implementatie van instantie-gebaseerde algoritmen voor gesuperviseerd
rangschikken", Stijn Lievens, Ghent University, 2004.
- Version:
- $Revision: 1.1 $
- Author:
- Stijn Lievens (stijn.lievens@ugent.be)
Method Summary |
double |
loss(double actual,
double predicted)
Returns the zero-one loss function between two class values. |
java.lang.String |
toString()
Returns a string with the name of the loss function. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ZeroOneLossFunction
public ZeroOneLossFunction()
loss
public final double loss(double actual,
double predicted)
- Returns the zero-one loss function between two class values.
- Specified by:
loss
in interface NominalLossFunction
- Parameters:
actual
- the actual class valuepredicted
- the predicted class value
- Returns:
- 1 if the actual and predicted value differ, 0 otherwise
toString
public java.lang.String toString()
- Returns a string with the name of the loss function.
- Overrides:
toString
in class java.lang.Object
- Returns:
- a string with the name of the loss function