mulan.classifier.transformation
Class CalibratedLabelRanking

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

public class CalibratedLabelRanking
extends TransformationBasedMultiLabelLearner

Class implementing the Calibrated Label Ranking (CLR) algorithm. For more information, see

Fuernkranz, Johannes, Huellermeier, Eyke, Loza Mencia, Eneldo, Brinker, Klaus (2008). Multilabel classification via calibrated label ranking. Machine Learning. 73(2):133--153.

BibTeX:

 @article{Fuernkranz2008,
    author = {Fuernkranz, Johannes and Huellermeier, Eyke and Loza Mencia, Eneldo and Brinker, Klaus},
    journal = {Machine Learning},
    number = {2},
    pages = {133--153},
    title = {Multilabel classification via calibrated label ranking},
    volume = {73},
    year = {2008}
 }
 

Version:
2012.02.27
Author:
Elise Rairat, Sang-Hyeun Park, Grigorios Tsoumakas
See Also:
Serialized Form

Field Summary
protected  Instances[] metaDataTest
          headers of the training sets of the one vs one models
protected  boolean[] nodata
          whether no data exist for one-vs-one learning
protected  int numModels
          number of one vs one models
protected  Classifier[] oneVsOneModels
          array holding the one vs one models
protected  Instances trainingdata
          temporary training data for each one vs one model
protected  BinaryRelevance virtualLabelModels
          binary relevance models for the virtual label
 
Fields inherited from class mulan.classifier.transformation.TransformationBasedMultiLabelLearner
baseClassifier
 
Fields inherited from class mulan.classifier.MultiLabelLearnerBase
featureIndices, labelIndices, numLabels
 
Constructor Summary
CalibratedLabelRanking()
          Default constructor using J48 as underlying classifier
CalibratedLabelRanking(Classifier classifier)
          Constructor that initializes the learner with a base algorithm
 
Method Summary
protected  void buildInternal(MultiLabelInstances trainingSet)
          Learner specific implementation of building the model from MultiLabelInstances training data set.
 boolean getStandardVoting()
          Get whether standard voting is turned on.
 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)
          This method does a prediction for an instance with the values of label missing Temporary included to switch between standard voting and qweighted multilabel voting
 MultiLabelOutput makePredictionQW(Instance instance)
          This method does a prediction for an instance with the values of label missing according to QWeighted algorithm for Multilabel Classification (QCMLPP2), which is described in : Loza Mencia, E., Park, S.
 MultiLabelOutput makePredictionStandard(Instance instance)
          This method does a prediction for an instance with the values of label missing
 void setStandardVoting(boolean standardVoting)
          Set Prediction to standard voting mode.
 
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

oneVsOneModels

protected Classifier[] oneVsOneModels
array holding the one vs one models


numModels

protected int numModels
number of one vs one models


trainingdata

protected Instances trainingdata
temporary training data for each one vs one model


metaDataTest

protected Instances[] metaDataTest
headers of the training sets of the one vs one models


virtualLabelModels

protected BinaryRelevance virtualLabelModels
binary relevance models for the virtual label


nodata

protected boolean[] nodata
whether no data exist for one-vs-one learning

Constructor Detail

CalibratedLabelRanking

public CalibratedLabelRanking()
Default constructor using J48 as underlying classifier


CalibratedLabelRanking

public CalibratedLabelRanking(Classifier classifier)
Constructor that initializes the learner with a base algorithm

Parameters:
classifier - the binary classification algorithm to use
Method Detail

setStandardVoting

public void setStandardVoting(boolean standardVoting)
Set Prediction to standard voting mode.

Parameters:
standardVoting - true if standard voting should be used

getStandardVoting

public boolean getStandardVoting()
Get whether standard voting is turned on.

Returns:
true if standard voting is on

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
This method does a prediction for an instance with the values of label missing Temporary included to switch between standard voting and qweighted multilabel voting

Specified by:
makePredictionInternal in class MultiLabelLearnerBase
Parameters:
instance -
Returns:
prediction
Throws:
Exception
InvalidDataException - if specified instance data is invalid and can not be processed by the learner

makePredictionStandard

public MultiLabelOutput makePredictionStandard(Instance instance)
                                        throws Exception
This method does a prediction for an instance with the values of label missing

Parameters:
instance -
Returns:
prediction
Throws:
Exception

makePredictionQW

public MultiLabelOutput makePredictionQW(Instance instance)
                                  throws Exception
This method does a prediction for an instance with the values of label missing according to QWeighted algorithm for Multilabel Classification (QCMLPP2), which is described in : Loza Mencia, E., Park, S.-H., and Fuernkranz, J. (2009) Efficient voting prediction for pairwise multilabel classification. In Proceedings of 17th European Symposium on Artificial Neural Networks (ESANN 2009), Bruges (Belgium), April 2009 This method reduces the number of classifier evaluations and guarantees the same Multilabel Output as ordinary Voting. But: the estimated confidences are only approximated. Therefore, ranking-based performances are worse than ordinary voting.

Parameters:
instance -
Returns:
prediction
Throws:
Exception

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