mulan.classifier.meta
Class RAkEL

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

public class RAkEL
extends MultiLabelMetaLearner

Class implementing a generalized version of the RAkEL (RAndom k-labELsets) algorithm. For more information, see

Grigorios Tsoumakas, Ioannis Katakis, Ioannis Vlahavas (2011). Random k-Labelsets for Multi-Label Classification. IEEE Transactions on Knowledge and Data Engineering. 23(7):1079-1089.

BibTeX:

 @article{Tsoumakas2011,
    author = {Grigorios Tsoumakas and Ioannis Katakis and Ioannis Vlahavas},
    journal = {IEEE Transactions on Knowledge and Data Engineering},
    number = {7},
    pages = {1079-1089},
    title = {Random k-Labelsets for Multi-Label Classification},
    volume = {23},
    year = {2011}
 }
 

Version:
2012.1.27
Author:
Grigorios Tsoumakas
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
RAkEL()
          Default constructor
RAkEL(MultiLabelLearner baseLearner)
          Creates an instance based on a given multi-label learner
RAkEL(MultiLabelLearner baseLearner, int models, int subset)
          Creates an instance given a specific multi-label learner, number of models and size of subsets
RAkEL(MultiLabelLearner baseLearner, int models, int subset, double threshold)
          Creates an instance given a specific multi-label learner, number of models, size of subsets and threshold
 
Method Summary
static int binomial(int n, int m)
          The binomial function
protected  void buildInternal(MultiLabelInstances trainingData)
          Learner specific implementation of building the model from MultiLabelInstances training data set.
 int getNumModels()
          Returns the number of models
 int getSizeOfSubset()
          Returns the size of the subsets
 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 setNumModels(int models)
          Sets the number of models
 void setSeed(int x)
          Sets the seed for random number generation
 void setSizeOfSubset(int size)
          Sets the size of the subsets
 
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

RAkEL

public RAkEL()
Default constructor


RAkEL

public RAkEL(MultiLabelLearner baseLearner)
Creates an instance based on a given multi-label learner

Parameters:
baseLearner - the multi-label learner

RAkEL

public RAkEL(MultiLabelLearner baseLearner,
             int models,
             int subset)
Creates an instance given a specific multi-label learner, number of models and size of subsets

Parameters:
baseLearner - a multi-label learner
models - a number of models
subset - a size of subsets

RAkEL

public RAkEL(MultiLabelLearner baseLearner,
             int models,
             int subset,
             double threshold)
Creates an instance given a specific multi-label learner, number of models, size of subsets and threshold

Parameters:
baseLearner - a multi-label learner
models - a number of models
subset - a size of subsets
threshold - a threshold
Method Detail

getTechnicalInformation

public 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.

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

setSeed

public void setSeed(int x)
Sets the seed for random number generation

Parameters:
x - the seed

setSizeOfSubset

public void setSizeOfSubset(int size)
Sets the size of the subsets

Parameters:
size - the size of the subsets

getSizeOfSubset

public int getSizeOfSubset()
Returns the size of the subsets

Returns:
the size of the subsets

setNumModels

public void setNumModels(int models)
Sets the number of models

Parameters:
models - number of models

getNumModels

public int getNumModels()
Returns the number of models

Returns:
number of models

binomial

public static int binomial(int n,
                           int m)
The binomial function

Parameters:
n -
m -
Returns:

buildInternal

protected void buildInternal(MultiLabelInstances trainingData)
                      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:
trainingData - 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

globalInfo

public String globalInfo()
Returns a string describing classifier

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