mulan.evaluation.loss
Class HammingLoss
java.lang.Object
mulan.evaluation.loss.BipartitionLossFunctionBase
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
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HammingLoss
public HammingLoss()
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 examplegroundTruth
- the ground truth of the example
- Returns:
- the value of the loss function