mulan.classifier.meta.thresholding
Class Meta

java.lang.Object
  extended by mulan.classifier.MultiLabelLearnerBase
      extended by mulan.classifier.meta.MultiLabelMetaLearner
          extended by mulan.classifier.meta.thresholding.Meta
All Implemented Interfaces:
Serializable, MultiLabelLearner, TechnicalInformationHandler
Direct Known Subclasses:
MetaLabeler, ThresholdPrediction

public abstract class Meta
extends MultiLabelMetaLearner

Base class for instance-based prediction of a bipartition from the labels' scores

Version:
2010.12.14
Author:
Marios Ioannou, George Sakkas, Grigorios Tsoumakas
See Also:
Serialized Form

Field Summary
protected  Classifier classifier
          the classifier to learn the number of top labels or the threshold
protected  Instances classifierInstances
          the training instances for the single-label model
protected  MultiLabelLearner foldLearner
          clean multi-label learner for cross-validation
protected  int kFoldsCV
          the number of folds for cross validation
protected  String metaDatasetChoice
          the type for constructing the meta dataset
 
Fields inherited from class mulan.classifier.meta.MultiLabelMetaLearner
baseLearner
 
Fields inherited from class mulan.classifier.MultiLabelLearnerBase
featureIndices, labelIndices, numLabels
 
Constructor Summary
Meta(MultiLabelLearner baseLearner, Classifier aClassifier, String aMetaDatasetChoice)
          Constructor that initializes the learner
 
Method Summary
protected  void buildInternal(MultiLabelInstances trainingData)
          Learner specific implementation of building the model from MultiLabelInstances training data set.
 Classifier getClassifier()
          Returns the classifier used to predict the number of labels/threshold
protected  Instance modifiedInstanceX(Instance instance, String xBased)
          A method that modify an instance
protected  Instances prepareClassifierInstances(MultiLabelInstances data)
          Prepares the instances for the predictor of labels/threshold
protected abstract  Instances transformData(MultiLabelInstances trainingData)
          abstract method that transforms the training data to meta data
protected  void valuesX(MultiLabelLearner learner, Instance instance, double[] newValues, String xBased)
          A method that fill the array "newValues"
 
Methods inherited from class mulan.classifier.meta.MultiLabelMetaLearner
getBaseLearner
 
Methods inherited from class mulan.classifier.MultiLabelLearnerBase
build, debug, getDebug, getTechnicalInformation, globalInfo, isModelInitialized, isUpdatable, makeCopy, makePrediction, makePredictionInternal, setDebug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classifier

protected Classifier classifier
the classifier to learn the number of top labels or the threshold


classifierInstances

protected Instances classifierInstances
the training instances for the single-label model


metaDatasetChoice

protected String metaDatasetChoice
the type for constructing the meta dataset


kFoldsCV

protected int kFoldsCV
the number of folds for cross validation


foldLearner

protected MultiLabelLearner foldLearner
clean multi-label learner for cross-validation

Constructor Detail

Meta

public Meta(MultiLabelLearner baseLearner,
            Classifier aClassifier,
            String aMetaDatasetChoice)
Constructor that initializes the learner

Parameters:
baseLearner - the MultiLabelLearner
aClassifier - the learner that will predict the number of relevant labels or a threshold
aMetaDatasetChoice - what features to use for predicting the number of relevant labels or a threshold
Method Detail

getClassifier

public Classifier getClassifier()
Returns the classifier used to predict the number of labels/threshold

Returns:
the classifier used to predict the number of labels/threshold

transformData

protected abstract Instances transformData(MultiLabelInstances trainingData)
                                    throws Exception
abstract method that transforms the training data to meta data

Parameters:
trainingData - the training data set
Returns:
the meta data for training the predictor of labels/threshold
Throws:
Exception

modifiedInstanceX

protected Instance modifiedInstanceX(Instance instance,
                                     String xBased)
A method that modify an instance

Parameters:
instance - to modified
xBased - the type for constructing the meta dataset
Returns:
a transformed instance for the predictor of labels/threshold

prepareClassifierInstances

protected Instances prepareClassifierInstances(MultiLabelInstances data)
Prepares the instances for the predictor of labels/threshold

Parameters:
data - the training data
Returns:
the prepared instances

valuesX

protected void valuesX(MultiLabelLearner learner,
                       Instance instance,
                       double[] newValues,
                       String xBased)
                throws Exception
A method that fill the array "newValues"

Parameters:
learner - the multi-label learner
instance - the training instances
newValues - the array to fill
xBased - the type for constructing the meta dataset
Throws:
Exception

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