mulan.evaluation.loss
Class HierarchicalLoss

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

public class HierarchicalLoss
extends BipartitionLossFunctionBase

Implementation of the hierarchical loss function.

Version:
2010.12.10
Author:
George Saridis, Grigorios Tsoumakas
See Also:
Serialized Form

Constructor Summary
HierarchicalLoss(MultiLabelInstances data)
          Creates a new instance of this class
 
Method Summary
 double computeLoss(boolean[] bipartition, boolean[] truth)
          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

HierarchicalLoss

public HierarchicalLoss(MultiLabelInstances data)
Creates a new instance of this class

Parameters:
data - the training data
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[] truth)
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
truth - the ground truth of the example
Returns:
the value of the loss function