mulan.classifier.transformation
Class EnsembleOfClassifierChains

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

public class EnsembleOfClassifierChains
extends TransformationBasedMultiLabelLearner

Class implementing the Ensemble of Classifier Chains(ECC) 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  int BagSizePercent
          The size of each bag sample, as a percentage of the training size.
protected  ClassifierChain[] ensemble
          An array of ClassifierChain models
protected  int numOfModels
          The number of classifier chain models
protected  Random rand
          Random number generator
protected  double samplingPercentage
          The size of each sample, as a percentage of the training size Used when useSamplingWithReplacement is false
protected  boolean useConfidences
          Whether the output is computed based on the average votes or on the average confidences
protected  boolean useSamplingWithReplacement
          Whether to use sampling with replacement to create the data of the models of the ensemble
 
Fields inherited from class mulan.classifier.transformation.TransformationBasedMultiLabelLearner
baseClassifier
 
Fields inherited from class mulan.classifier.MultiLabelLearnerBase
featureIndices, labelIndices, numLabels
 
Constructor Summary
EnsembleOfClassifierChains()
          Default constructor
EnsembleOfClassifierChains(Classifier classifier, int aNumOfModels, boolean doUseConfidences, boolean doUseSamplingWithReplacement)
          Creates a new object
 
Method Summary
protected  void buildInternal(MultiLabelInstances trainingSet)
          Learner specific implementation of building the model from MultiLabelInstances training data set.
 int getBagSizePercent()
          Returns the size of each bag sample, as a percentage of the training size
 double getSamplingPercentage()
          Returns the sampling percentage
 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 classifier.
protected  MultiLabelOutput makePredictionInternal(Instance instance)
          Learner specific implementation for predicting on specified data based on trained model.
 void setBagSizePercent(int bagSizePercent)
          Sets the size of each bag sample, as a percentage of the training size
 void setSamplingPercentage(double samplingPercentage)
          Sets the sampling percentage
 
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

numOfModels

protected int numOfModels
The number of classifier chain models


ensemble

protected ClassifierChain[] ensemble
An array of ClassifierChain models


rand

protected Random rand
Random number generator


useConfidences

protected boolean useConfidences
Whether the output is computed based on the average votes or on the average confidences


useSamplingWithReplacement

protected boolean useSamplingWithReplacement
Whether to use sampling with replacement to create the data of the models of the ensemble


BagSizePercent

protected int BagSizePercent
The size of each bag sample, as a percentage of the training size. Used when useSamplingWithReplacement is true


samplingPercentage

protected double samplingPercentage
The size of each sample, as a percentage of the training size Used when useSamplingWithReplacement is false

Constructor Detail

EnsembleOfClassifierChains

public EnsembleOfClassifierChains()
Default constructor


EnsembleOfClassifierChains

public EnsembleOfClassifierChains(Classifier classifier,
                                  int aNumOfModels,
                                  boolean doUseConfidences,
                                  boolean doUseSamplingWithReplacement)
Creates a new object

Parameters:
classifier - the base classifier for each ClassifierChain model
aNumOfModels - the number of models
doUseConfidences -
doUseSamplingWithReplacement -
Method Detail

getBagSizePercent

public int getBagSizePercent()
Returns the size of each bag sample, as a percentage of the training size

Returns:
the size of each bag sample, as a percentage of the training size

setBagSizePercent

public void setBagSizePercent(int bagSizePercent)
Sets the size of each bag sample, as a percentage of the training size

Parameters:
bagSizePercent - the size of each bag sample, as a percentage of the training size

getSamplingPercentage

public double getSamplingPercentage()
Returns the sampling percentage

Returns:
the sampling percentage

setSamplingPercentage

public void setSamplingPercentage(double samplingPercentage)
Sets the sampling percentage

Parameters:
samplingPercentage - the sampling percentage

globalInfo

public String globalInfo()
Returns a string describing classifier.

Overrides:
globalInfo in class TransformationBasedMultiLabelLearner
Returns:
a description suitable for displaying in the explorer/experimenter gui

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 trainingSet)
                      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:
trainingSet - the training data set
Throws:
Exception - if learner model was not created successfully

makePredictionInternal

protected MultiLabelOutput makePredictionInternal(Instance instance)
                                           throws Exception,
                                                  InvalidDataException
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