ZeroOneLossFunction

Overview | Package | Class | Tree | Deprecated | Index | Help | Weka's home

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## weka.classifiers.misc.monotone
Class ZeroOneLossFunction

    java.lang.Object
      weka.classifiers.misc.monotone.ZeroOneLossFunction

All Implemented Interfaces:
  NominalLossFunction, RevisionHandler

    public class ZeroOneLossFunction

extends java.lang.Object
implements NominalLossFunction, RevisionHandler

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.2 $
Author:
  Stijn Lievens (stijn.lievens@ugent.be)

Constructor Summary
`ZeroOneLossFunction()`

Method Summary
`java.lang.String` | `getRevision()` Returns the revision string.
`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`

Constructor Detail

### ZeroOneLossFunction

    public ZeroOneLossFunction()

Method Detail

### 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 value
    `predicted` - 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

### getRevision

    public java.lang.String getRevision()

  Returns the revision string.

  Specified by:
    `getRevision` in interface `RevisionHandler`
  Returns:
    the revision

Overview | Package | Class | Tree | Deprecated | Index | Help | Weka's home

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD