mulan.evaluation.loss
Class HammingLoss

java.lang.Object
  extended by mulan.evaluation.loss.BipartitionLossFunctionBase
      extended by mulan.evaluation.loss.HammingLoss
All Implemented Interfaces:
Serializable, BipartitionLossFunction, MultiLabelLossFunction

public class HammingLoss
extends BipartitionLossFunctionBase

Implementation of the hamming loss function. It is basically the symmetric difference between the predicted and ground truth labels

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

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

Constructor Detail

HammingLoss

public HammingLoss()
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(boolean[] bipartition,
                          boolean[] groundTruth)
Description copied from interface: BipartitionLossFunction
Computes the bipartition loss function

Specified by:
computeLoss in interface BipartitionLossFunction
Specified by:
computeLoss in class BipartitionLossFunctionBase
Parameters:
bipartition - the biprtition of the learner for an example
groundTruth - the ground truth of the example
Returns:
the value of the loss function