mulan.evaluation.loss
Class RankingLossFunctionBase

java.lang.Object
  extended by mulan.evaluation.loss.RankingLossFunctionBase
All Implemented Interfaces:
Serializable, MultiLabelLossFunction, RankingLossFunction
Direct Known Subclasses:
ErrorSetSize, IsError, OneError, OneMinusAveragePrecision

public abstract class RankingLossFunctionBase
extends Object
implements RankingLossFunction, Serializable

Base class for ranking loss functions

Version:
2010.11.10
Author:
GrigoriosTsoumakas
See Also:
Serialized Form

Constructor Summary
RankingLossFunctionBase()
           
 
Method Summary
abstract  double computeLoss(int[] ranking, boolean[] groundTruth)
          Computes the ranking loss function
 double computeLoss(MultiLabelOutput prediction, boolean[] groundTruth)
          Computes the loss function
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface mulan.evaluation.loss.MultiLabelLossFunction
getName
 

Constructor Detail

RankingLossFunctionBase

public RankingLossFunctionBase()
Method Detail

computeLoss

public final double computeLoss(MultiLabelOutput prediction,
                                boolean[] groundTruth)
Description copied from interface: MultiLabelLossFunction
Computes the loss function

Specified by:
computeLoss in interface MultiLabelLossFunction
Parameters:
prediction - the prediction of the learner for an example
groundTruth - the ground truth of the example
Returns:
the value of the loss function

computeLoss

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

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