mulan.transformations
Class BinaryRelevanceTransformation

java.lang.Object
  extended by mulan.transformations.BinaryRelevanceTransformation
All Implemented Interfaces:
Serializable

public class BinaryRelevanceTransformation
extends Object
implements Serializable

Class that implements the binary relevance transformation

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

Constructor Summary
BinaryRelevanceTransformation(MultiLabelInstances data)
          Constructor
 
Method Summary
 Instance transformInstance(Instance instance, int labelToKeep)
          Remove all label attributes except labelToKeep
static Instance transformInstance(Instance instance, int[] labelIndices, int indexToKeep)
          Remove all label attributes except label at position indexToKeep
static Instances transformInstances(Instances train, int[] labelIndices, int indexToKeep)
          Remove all label attributes except that at indexOfLabelToKeep
 Instances transformInstances(int labelToKeep)
          Remove all label attributes except labelToKeep
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryRelevanceTransformation

public BinaryRelevanceTransformation(MultiLabelInstances data)
Constructor

Parameters:
data - a multi-label dataset
Method Detail

transformInstance

public Instance transformInstance(Instance instance,
                                  int labelToKeep)
Remove all label attributes except labelToKeep

Parameters:
instance -
labelToKeep -
Returns:
transformed Instance

transformInstances

public Instances transformInstances(int labelToKeep)
                             throws Exception
Remove all label attributes except labelToKeep

Parameters:
labelToKeep -
Returns:
transformed Instances object
Throws:
Exception

transformInstances

public static Instances transformInstances(Instances train,
                                           int[] labelIndices,
                                           int indexToKeep)
                                    throws Exception
Remove all label attributes except that at indexOfLabelToKeep

Parameters:
train -
labelIndices -
indexToKeep -
Returns:
transformed Instances object
Throws:
Exception

transformInstance

public static Instance transformInstance(Instance instance,
                                         int[] labelIndices,
                                         int indexToKeep)
Remove all label attributes except label at position indexToKeep

Parameters:
instance -
labelIndices -
indexToKeep -
Returns:
transformed Instance