mulan.evaluation.loss
Class IsError

java.lang.Object
  extended by mulan.evaluation.loss.RankingLossFunctionBase
      extended by mulan.evaluation.loss.IsError
All Implemented Interfaces:
Serializable, MultiLabelLossFunction, RankingLossFunction

public class IsError
extends RankingLossFunctionBase

Implementation of the IsError loss function, which is simply the indicator of whether the induced ranking is perfect or not. Speaking in terms of error set, the loss is zero if the cardinality of the error-set is zero and one if the cardinality of the error set is greather than zero.

Version:
2010.11.10
Author:
Grigorios Tsoumakas
See Also:
Serialized Form

Constructor Summary
IsError()
           
 
Method Summary
 double computeLoss(int[] ranking, boolean[] groundTruth)
          Computes the ranking loss function
 String getName()
          Returns the name of the loss function
 
Methods inherited from class mulan.evaluation.loss.RankingLossFunctionBase
computeLoss
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IsError

public IsError()
Method Detail

getName

public String getName()
Description copied from interface: MultiLabelLossFunction
Returns the name of the loss function

Returns:
the name of the loss function

computeLoss

public double computeLoss(int[] ranking,
                          boolean[] groundTruth)
Description copied from interface: RankingLossFunction
Computes the ranking loss function

Specified by:
computeLoss in interface RankingLossFunction
Specified by:
computeLoss in class RankingLossFunctionBase
Parameters:
ranking - the ranking of the learner for an example
groundTruth - the ground truth of the example
Returns:
the value of the loss function