mulan.classifier.transformation
Class IncludeLabelsClassifier
java.lang.Object
mulan.classifier.MultiLabelLearnerBase
mulan.classifier.transformation.TransformationBasedMultiLabelLearner
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.
IncludeLabelsClassifier
public IncludeLabelsClassifier(Classifier classifier)
- Constructor that initializes a new learner with the given base classifier
- Parameters:
classifier
-
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