mulan.classifier.meta
Class EnsembleOfSubsetLearners

java.lang.Object
  extended by mulan.classifier.MultiLabelLearnerBase
      extended by mulan.classifier.meta.MultiLabelMetaLearner
          extended by mulan.classifier.meta.EnsembleOfSubsetLearners
All Implemented Interfaces:
Serializable, MultiLabelLearner, TechnicalInformationHandler

public class EnsembleOfSubsetLearners
extends MultiLabelMetaLearner

A class for gathering several different SubsetLearners into a composite ensemble model. <br> <br> The label set partitions for participation in ensemble are selected using their dependence weight from the large number of randomly generated possible partitions. The type of the learned dependencies is determined by the {@link mulan.data.LabelPairsDependenceIdentifier} supplied to the class constructor. Two strategies for selecting ensemble partitions exists: (1) to select the highly weighted ones and (2) to select most different from the highly weighted ones. The strategy to be used is determined by the {@link #selectDiverseModels} parameter which is 'true' by default.

For more information, see

Lena Tenenboim-Chekina, Lior Rokach,, Bracha Shapira: Identification of Label Dependencies for Multi-label Classification. In: , Haifa, Israel, 53--60, 2010.

BibTeX:

 @inproceedings{LenaTenenboim-Chekina2010,
    address = {Haifa, Israel},
    author = {Lena Tenenboim-Chekina, Lior Rokach, and Bracha Shapira},
    pages = {53--60},
    title = {Identification of Label Dependencies for Multi-label Classification},
    volume = {Proc. ICML 2010 Workshop on Learning from Multi-Label Data (MLD'10},
    year = {2010}
 }
 

Version:
30.11.2010
Author:
Lena Chekina (lenat@bgu.ac.il)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class mulan.classifier.meta.MultiLabelMetaLearner
baseLearner
 
Fields inherited from class mulan.classifier.MultiLabelLearnerBase
featureIndices, labelIndices, numLabels
 
Constructor Summary
EnsembleOfSubsetLearners()
          Default constructor.
EnsembleOfSubsetLearners(MultiLabelLearner aMultiLabelLearner, Classifier aSingleLabelLearner, LabelPairsDependenceIdentifier aDependenceIdentifier, int models)
          Initialize EnsembleOfSubset with multilabel and single label learners, a method for labels dependence identification and number of models to constitute the ensemble.
 
Method Summary
protected  void buildInternal(MultiLabelInstances trainingData)
          Builds an ensemble of Subset models.
 List<int[][]> createRandomSets(int numLabels, int numSets)
          Creates the specified number of randomly generated possible label set partitions consisting of the specified number of labels..
 int getNumModels()
           
 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 multi-label learner.
 boolean isSelectDiverseModels()
           
protected  MultiLabelOutput makePredictionInternal(Instance instance)
          Makes classification prediction using constructed ensemble of Subset models.
static String partitionToString(int[][] partition)
          Returns a string representation of the labels partition.
 void setDependenceIdentifier(LabelPairsDependenceIdentifier dependenceIdentifier)
           
static void setDynamicDiversityThreshold(double dynamicDiversityThreshold)
           
 void setNumModels(int models)
           
static void setNumOfPartitionsForDiversity(int numOfPartitionsForDiversity)
           
static void setNumOfRandomPartitions(int numOfRandomPartitions)
           
 void setRnd(Random rnd)
           
 void setSeed(int x)
           
 void setSelectDiverseModels(boolean selectDiverseModels)
           
 void setThreshold(double threshold)
           
 void setUseSubsetLearnerCache(boolean useSubsetcache)
           
 
Methods inherited from class mulan.classifier.meta.MultiLabelMetaLearner
getBaseLearner
 
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

EnsembleOfSubsetLearners

public EnsembleOfSubsetLearners()
Default constructor. Can be used for accessing class utility methods.


EnsembleOfSubsetLearners

public EnsembleOfSubsetLearners(MultiLabelLearner aMultiLabelLearner,
                                Classifier aSingleLabelLearner,
                                LabelPairsDependenceIdentifier aDependenceIdentifier,
                                int models)
Initialize EnsembleOfSubset with multilabel and single label learners, a method for labels dependence identification and number of models to constitute the ensemble.

Parameters:
aMultiLabelLearner - the learner for multilabel classification
aSingleLabelLearner - the learner for single label classification
aDependenceIdentifier - the method for label pairs dependence identification
models - the number of models
Method Detail

getTechnicalInformation

public TechnicalInformation getTechnicalInformation()
Description copied from class: MultiLabelLearnerBase
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
Specified by:
getTechnicalInformation in class MultiLabelLearnerBase
Returns:
the technical information about this class

buildInternal

protected void buildInternal(MultiLabelInstances trainingData)
                      throws Exception
Builds an ensemble of Subset models. Label set partitions for ensemble are selected based on the set dependenceIdentifier and value of the selectDiverseModels parameter.

Specified by:
buildInternal in class MultiLabelLearnerBase
Parameters:
trainingData - the training data set
Throws:
Exception - if learner model was not created successfully

makePredictionInternal

protected MultiLabelOutput makePredictionInternal(Instance instance)
                                           throws Exception
Makes classification prediction using constructed ensemble of Subset models. For each label models' votes are summarized, and confidence is computed as average of positive predictions.

Specified by:
makePredictionInternal in class MultiLabelLearnerBase
Parameters:
instance - the data instance to predict on
Returns:
the MultiLabelOutput classification prediction for the instance.
Throws:
Exception
InvalidDataException - if specified instance data is invalid and can not be processed by the learner

createRandomSets

public List<int[][]> createRandomSets(int numLabels,
                                      int numSets)
Creates the specified number of randomly generated possible label set partitions consisting of the specified number of labels..

Parameters:
numLabels - - number of labels
numSets - - number of random partitions to generate
Returns:
a list of generated partitions

partitionToString

public static String partitionToString(int[][] partition)
Returns a string representation of the labels partition.

Parameters:
partition - - a label set partition
Returns:
a string representation of the labels partition

setRnd

public void setRnd(Random rnd)
Parameters:
rnd -

setThreshold

public void setThreshold(double threshold)
Parameters:
threshold -

setDependenceIdentifier

public void setDependenceIdentifier(LabelPairsDependenceIdentifier dependenceIdentifier)
Parameters:
dependenceIdentifier -

setSeed

public void setSeed(int x)
Parameters:
x -

setNumModels

public void setNumModels(int models)
Parameters:
models -

getNumModels

public int getNumModels()
Returns:

isSelectDiverseModels

public boolean isSelectDiverseModels()
Returns:

setSelectDiverseModels

public void setSelectDiverseModels(boolean selectDiverseModels)
Parameters:
selectDiverseModels -

setUseSubsetLearnerCache

public void setUseSubsetLearnerCache(boolean useSubsetcache)
Parameters:
useSubsetcache -

setNumOfRandomPartitions

public static void setNumOfRandomPartitions(int numOfRandomPartitions)
Parameters:
numOfRandomPartitions -

setNumOfPartitionsForDiversity

public static void setNumOfPartitionsForDiversity(int numOfPartitionsForDiversity)
Parameters:
numOfPartitionsForDiversity -

setDynamicDiversityThreshold

public static void setDynamicDiversityThreshold(double dynamicDiversityThreshold)
Parameters:
dynamicDiversityThreshold -

globalInfo

public String globalInfo()
Description copied from class: MultiLabelLearnerBase
Returns a string describing the multi-label learner.

Specified by:
globalInfo in class MultiLabelLearnerBase
Returns:
a description suitable for displaying in a future gui