mulan.classifier.transformation
Class MultiClassLearner

java.lang.Object
  extended by mulan.classifier.MultiLabelLearnerBase
      extended by mulan.classifier.transformation.TransformationBasedMultiLabelLearner
          extended by mulan.classifier.transformation.MultiClassLearner
All Implemented Interfaces:
Serializable, MultiLabelLearner, TechnicalInformationHandler

public class MultiClassLearner
extends TransformationBasedMultiLabelLearner

Version:
2012.02.27
Author:
Stavros Mpakirtzoglou, Grigorios Tsoumakas
See Also:
Serialized Form

Field Summary
 
Fields inherited from class mulan.classifier.transformation.TransformationBasedMultiLabelLearner
baseClassifier
 
Fields inherited from class mulan.classifier.MultiLabelLearnerBase
featureIndices, labelIndices, numLabels
 
Constructor Summary
MultiClassLearner(Classifier baseClassifier, MultiClassTransformation dt)
          Initializes learner
 
Method Summary
protected  void buildInternal(MultiLabelInstances train)
          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
 

Constructor Detail

MultiClassLearner

public MultiClassLearner(Classifier baseClassifier,
                         MultiClassTransformation dt)
Initializes learner

Parameters:
baseClassifier - the base single-label classification algorithm
dt - the MultiClassTransformation to use
Method Detail

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)
                                           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