mulan.classifier.transformation
Class ClassifierChain

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

public class ClassifierChain
extends TransformationBasedMultiLabelLearner

Class implementing the Classifier Chain (CC) algorithm.

For more information, see

Read, Jesse, Pfahringer, Bernhard, Holmes, Geoff, Frank, Eibe: Classifier Chains for Multi-label Classification. In: , 335--359, 2011.

BibTeX:

 @inproceedings{Read2011,
    author = {Read, Jesse and Pfahringer, Bernhard and Holmes, Geoff and Frank, Eibe},
    journal = {Machine Learning},
    number = {3},
    pages = {335--359},
    title = {Classifier Chains for Multi-label Classification},
    volume = {85},
    year = {2011}
 }
 

Version:
2012.02.27
Author:
Eleftherios Spyromitros-Xioufis ( espyromi@csd.auth.gr ), Konstantinos Sechidis (sechidis@csd.auth.gr), Grigorios Tsoumakas (greg@csd.auth.gr)
See Also:
Serialized Form

Field Summary
protected  FilteredClassifier[] ensemble
          The ensemble of binary relevance models.
 
Fields inherited from class mulan.classifier.transformation.TransformationBasedMultiLabelLearner
baseClassifier
 
Fields inherited from class mulan.classifier.MultiLabelLearnerBase
featureIndices, labelIndices, numLabels
 
Constructor Summary
ClassifierChain()
          Creates a new instance using J48 as the underlying classifier
ClassifierChain(Classifier classifier)
          Creates a new instance
ClassifierChain(Classifier classifier, int[] aChain)
          Creates a new instance
 
Method Summary
protected  void buildInternal(MultiLabelInstances train)
          Learner specific implementation of building the model from MultiLabelInstances training data set.
 TechnicalInformation getTechnicalInformation()
          Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.
 String globalInfo()
          Returns a string describing the classifier.
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
 
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

ensemble

protected FilteredClassifier[] ensemble
The ensemble of binary relevance models. These are Weka FilteredClassifier objects, where the filter corresponds to removing all label apart from the one that serves as a target for the corresponding model.

Constructor Detail

ClassifierChain

public ClassifierChain()
Creates a new instance using J48 as the underlying classifier


ClassifierChain

public ClassifierChain(Classifier classifier,
                       int[] aChain)
Creates a new instance

Parameters:
classifier - the base-level classification algorithm that will be used for training each of the binary models
aChain -

ClassifierChain

public ClassifierChain(Classifier classifier)
Creates a new instance

Parameters:
classifier - the base-level classification algorithm that will be used for training each of the binary models
Method Detail

globalInfo

public String globalInfo()
Returns a string describing the classifier.

Overrides:
globalInfo in class TransformationBasedMultiLabelLearner
Returns:
a string description of the classifier

getTechnicalInformation

public TechnicalInformation getTechnicalInformation()
Description copied from class: TransformationBasedMultiLabelLearner
Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.

Specified by:
getTechnicalInformation in interface TechnicalInformationHandler
Overrides:
getTechnicalInformation in class TransformationBasedMultiLabelLearner
Returns:
the technical information about this class

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