mulan.classifier.transformation
Class BinaryRelevance
java.lang.Object
mulan.classifier.MultiLabelLearnerBase
mulan.classifier.transformation.TransformationBasedMultiLabelLearner
mulan.classifier.transformation.BinaryRelevance
- All Implemented Interfaces:
- Serializable, MultiLabelLearner, TechnicalInformationHandler
public class BinaryRelevance
- extends TransformationBasedMultiLabelLearner
- Version:
- 2012.03.14
- Author:
- Robert Friberg, Grigorios Tsoumakas
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ensemble
protected Classifier[] ensemble
- The ensemble of binary relevance models. These are Weka Classifier
objects.
BinaryRelevance
public BinaryRelevance(Classifier classifier)
- Creates a new instance
- Parameters:
classifier
- the base-level classification algorithm that will be
used for training each of the binary models
buildInternal
protected void buildInternal(MultiLabelInstances train)
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:
train
- the training data set
- Throws:
Exception
- if learner model was not created successfully
makePredictionInternal
protected MultiLabelOutput makePredictionInternal(Instance instance)
- 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
getModel
public Classifier getModel(String labelName)
- Returns the model which corresponds to the label with labelName
- Parameters:
labelName
-
- Returns:
- the corresponding model or null if the labelIndex is wrong