mulan.classifier.transformation
Class LabelPowerset

java.lang.Object
  extended by mulan.classifier.MultiLabelLearnerBase
      extended by mulan.classifier.transformation.TransformationBasedMultiLabelLearner
          extended by mulan.classifier.transformation.LabelPowerset
All Implemented Interfaces:
Serializable, MultiLabelLearner, TechnicalInformationHandler
Direct Known Subclasses:
LabelsetPruning

public class LabelPowerset
extends TransformationBasedMultiLabelLearner

Class that implements a label powerset classifier

Version:
2012.02.27
Author:
Grigorios Tsoumakas, Robert Friberg
See Also:
Serialized Form

Field Summary
protected  boolean makePredictionsBasedOnConfidences
          Whether the method introduced by the PPT algorithm will be used to actually get the 1/0 output bipartition based on the confidences (requires a threshold)
protected  Random Rand
          Random number generator for randomly solving tied predictions
protected  double threshold
          Threshold used for deciding the 1/0 output value of each label based on the corresponding confidences as calculated by the method introduced in the PPT algorithm
protected  LabelPowersetTransformation transformation
          The object that performs the data transformation
 
Fields inherited from class mulan.classifier.transformation.TransformationBasedMultiLabelLearner
baseClassifier
 
Fields inherited from class mulan.classifier.MultiLabelLearnerBase
featureIndices, labelIndices, numLabels
 
Constructor Summary
LabelPowerset(Classifier classifier)
          Conststructor that initializes the learner with a base classifier
 
Method Summary
protected  void buildInternal(MultiLabelInstances mlData)
          Learner specific implementation of building the model from MultiLabelInstances training data set.
protected  MultiLabelOutput makePredictionInternal(Instance instance)
          Learner specific implementation for predicting on specified data based on trained model.
 void setConfidenceCalculationMethod(int method)
          Sets the method of calculating probabilities for each label
 void setMakePredictionsBasedOnConfidences(boolean value)
          Sets a threshold for obtaining the bipartition
 void setSeed(int s)
          Setting a seed for random selection in case of ties during prediction
 void setThreshold(double t)
          The threshold for obtaining the bipartition from probabilities
 
Methods inherited from class mulan.classifier.transformation.TransformationBasedMultiLabelLearner
getBaseClassifier, getTechnicalInformation, globalInfo
 
Methods inherited from class mulan.classifier.MultiLabelLearnerBase
build, debug, getDebug, isModelInitialized, isUpdatable, makeCopy, makePrediction, setDebug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

makePredictionsBasedOnConfidences

protected boolean makePredictionsBasedOnConfidences
Whether the method introduced by the PPT algorithm will be used to actually get the 1/0 output bipartition based on the confidences (requires a threshold)


threshold

protected double threshold
Threshold used for deciding the 1/0 output value of each label based on the corresponding confidences as calculated by the method introduced in the PPT algorithm


transformation

protected LabelPowersetTransformation transformation
The object that performs the data transformation


Rand

protected Random Rand
Random number generator for randomly solving tied predictions

Constructor Detail

LabelPowerset

public LabelPowerset(Classifier classifier)
Conststructor that initializes the learner with a base classifier

Parameters:
classifier - the base single-label classification algorithm
Method Detail

setMakePredictionsBasedOnConfidences

public void setMakePredictionsBasedOnConfidences(boolean value)
Sets a threshold for obtaining the bipartition

Parameters:
value - the threshold's value

setSeed

public void setSeed(int s)
Setting a seed for random selection in case of ties during prediction

Parameters:
s - the seed

setThreshold

public void setThreshold(double t)
The threshold for obtaining the bipartition from probabilities

Parameters:
t -

setConfidenceCalculationMethod

public void setConfidenceCalculationMethod(int method)
Sets the method of calculating probabilities for each label

Parameters:
method -

buildInternal

protected void buildInternal(MultiLabelInstances mlData)
                      throws Exception
Description copied from class: MultiLabelLearnerBase
Learner specific implementation of building the model from MultiLabelInstances training data set. This method is called from MultiLabelLearnerBase.build(MultiLabelInstances) method, where behavior common across all learners is applied.

Specified by:
buildInternal in class MultiLabelLearnerBase
Parameters:
mlData - the training data set
Throws:
Exception - if learner model was not created successfully

makePredictionInternal

protected MultiLabelOutput makePredictionInternal(Instance instance)
                                           throws Exception
Description copied from class: MultiLabelLearnerBase
Learner specific implementation for predicting on specified data based on trained model. This method is called from MultiLabelLearnerBase.makePrediction(weka.core.Instance) which guards for model initialization and apply common handling/behavior.

Specified by:
makePredictionInternal in class MultiLabelLearnerBase
Parameters:
instance - the data instance to predict on
Returns:
the output of the learner for the given instance
Throws:
Exception - if an error occurs while making the prediction.
InvalidDataException - if specified instance data is invalid and can not be processed by the learner