mulan.classifier.neural
Class MMPLearner

java.lang.Object
  extended by mulan.classifier.MultiLabelLearnerBase
      extended by mulan.classifier.neural.MMPLearner
All Implemented Interfaces:
Serializable, MultiLabelLearner, TechnicalInformationHandler

public class MMPLearner
extends MultiLabelLearnerBase

Implementation of Multiclass Multilabel Perceptrons learner. For more information, see

Koby Crammer, Yoram Singer (2003). A Family of Additive Online Algorithms for Category Ranking.. Journal of Machine Learning Research. 3(6):1025-1058.

BibTeX:

 @article{KobyCrammer2003,
    author = {Koby Crammer, Yoram Singer},
    journal = {Journal of Machine Learning Research},
    pages = {1025-1058},
    title = {A Family of Additive Online Algorithms for Category Ranking.},
    volume = {3(6)},
    year = {2003}
 }
 

Version:
2012.02.27
Author:
Jozef Vilcek
See Also:
Serialized Form

Field Summary
 
Fields inherited from class mulan.classifier.MultiLabelLearnerBase
featureIndices, labelIndices, numLabels
 
Constructor Summary
MMPLearner()
          Default constructor using RankingLoss and uniform update
MMPLearner(RankingLossFunction lossMeasure, MMPUpdateRuleType modelUpdateRule)
          Creates a new instance of MMPLearner.
MMPLearner(RankingLossFunction lossMeasure, MMPUpdateRuleType modelUpdateRule, long randomnessSeed)
          Creates a new instance of MMPLearner.
 
Method Summary
protected  void buildInternal(MultiLabelInstances trainingSet)
          Learner specific implementation of building the model from MultiLabelInstances training data set.
 boolean getConvertNominalToBinary()
          Gets a value indication whether conversion of nominal attributes from input data set to binary takes place prior to learning (and respectively making a prediction).
 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.
 int getTrainingEpochs()
          Gets number of training epochs.
 String globalInfo()
          Returns a string describing the multi-label learner.
 boolean isUpdatable()
          Returns value indicating if learner is updatable, so if learner is able to perform on-line learning.
 MultiLabelOutput makePredictionInternal(Instance instance)
          Learner specific implementation for predicting on specified data based on trained model.
 void setConvertNominalToBinary(boolean convert)
          Sets whether nominal attributes from input data set has to be converted to binary prior to learning (and respectively making a prediction).
 void setTrainingEpochs(int epochs)
          Sets the number of training epochs.
 
Methods inherited from class mulan.classifier.MultiLabelLearnerBase
build, debug, getDebug, isModelInitialized, makeCopy, makePrediction, setDebug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MMPLearner

public MMPLearner()
Default constructor using RankingLoss and uniform update


MMPLearner

public MMPLearner(RankingLossFunction lossMeasure,
                  MMPUpdateRuleType modelUpdateRule)
Creates a new instance of MMPLearner.

Parameters:
lossMeasure - the loss measure to be used when judging ranking performance in learning process
modelUpdateRule -

MMPLearner

public MMPLearner(RankingLossFunction lossMeasure,
                  MMPUpdateRuleType modelUpdateRule,
                  long randomnessSeed)
Creates a new instance of MMPLearner.

Parameters:
lossMeasure - the loss measure to be used when judging ranking performance in learning process
modelUpdateRule -
randomnessSeed - the seed value for pseudo-random generator
Method Detail

setTrainingEpochs

public void setTrainingEpochs(int epochs)
Sets the number of training epochs. Must be greater than 0.
Default value is 1.

Parameters:
epochs - the number of training epochs
Throws:
IllegalArgumentException - if passed value is invalid

getTrainingEpochs

public int getTrainingEpochs()
Gets number of training epochs. Default value is 1.

Returns:
training epochs

setConvertNominalToBinary

public void setConvertNominalToBinary(boolean convert)
Sets whether nominal attributes from input data set has to be converted to binary prior to learning (and respectively making a prediction).

Parameters:
convert - flag indicating whether conversion should take place

getConvertNominalToBinary

public boolean getConvertNominalToBinary()
Gets a value indication whether conversion of nominal attributes from input data set to binary takes place prior to learning (and respectively making a prediction).

Returns:
value indication whether conversion takes place

isUpdatable

public boolean isUpdatable()
Description copied from interface: MultiLabelLearner
Returns value indicating if learner is updatable, so if learner is able to perform on-line learning. The fact if learner is updatable or not influences the behavior of MultiLabelLearner.build(MultiLabelInstances) method.

When false is returned, each call of the MultiLabelLearner.build(MultiLabelInstances) will initialize the learner from the scratch, removing any potential knowledge built by previously entered training data. When true is returned, then on the first call of the MultiLabelLearner.build(MultiLabelInstances) the learner is initialized with the passed training data. All other calls contribute to the existing learner's model with new data.

Specified by:
isUpdatable in interface MultiLabelLearner
Overrides:
isUpdatable in class MultiLabelLearnerBase
Returns:
true if learner is updatable (on-line), false otherwise.

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

public MultiLabelOutput makePredictionInternal(Instance instance)
                                        throws 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:
InvalidDataException - if specified instance data is invalid and can not be processed by the learner

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

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