mulan.classifier.transformation
Class IncludeLabelsClassifier

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

public class IncludeLabelsClassifier
extends TransformationBasedMultiLabelLearner

A multilabel classifier based on the include labels transformation. The multiple label attributes are mapped to two attributes: a) one nominal attribute containing the class b) one binary attribute containing whether it is true.

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

Field Summary
protected  Instances transformed
          A dataset with the format needed by the base classifier.
 
Fields inherited from class mulan.classifier.transformation.TransformationBasedMultiLabelLearner
baseClassifier
 
Fields inherited from class mulan.classifier.MultiLabelLearnerBase
featureIndices, labelIndices, numLabels
 
Constructor Summary
IncludeLabelsClassifier(Classifier classifier)
          Constructor that initializes a new learner with the given base classifier
 
Method Summary
 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.
 
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

transformed

protected Instances transformed
A dataset with the format needed by the base classifier. It is potentially expensive copying datasets with many attributes, so it is used for building the classifier and then it's mlData are discarded and it is reused during prediction.

Constructor Detail

IncludeLabelsClassifier

public IncludeLabelsClassifier(Classifier classifier)
Constructor that initializes a new learner with the given base classifier

Parameters:
classifier -
Method Detail

buildInternal

public 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