de.jstacs.classifiers.differentiableSequenceScoreBased.msp
Class MSPClassifier

java.lang.Object
  extended by de.jstacs.classifiers.AbstractClassifier
      extended by de.jstacs.classifiers.AbstractScoreBasedClassifier
          extended by de.jstacs.classifiers.differentiableSequenceScoreBased.ScoreClassifier
              extended by de.jstacs.classifiers.differentiableSequenceScoreBased.gendismix.GenDisMixClassifier
                  extended by de.jstacs.classifiers.differentiableSequenceScoreBased.msp.MSPClassifier
All Implemented Interfaces:
Storable, Cloneable

public class MSPClassifier
extends GenDisMixClassifier

This class implements a classifier that allows the training via MCL or MSP principle.

Author:
Jens Keilwagen, Jan Grau

Nested Class Summary
 
Nested classes/interfaces inherited from class de.jstacs.classifiers.AbstractScoreBasedClassifier
AbstractScoreBasedClassifier.DoubleTableResult
 
Field Summary
 
Fields inherited from class de.jstacs.classifiers.differentiableSequenceScoreBased.gendismix.GenDisMixClassifier
beta, function, prior
 
Fields inherited from class de.jstacs.classifiers.differentiableSequenceScoreBased.ScoreClassifier
hasBeenOptimized, NOT_TRAINED_VALUE, params, score, sostream, template
 
Constructor Summary
MSPClassifier(GenDisMixClassifierParameterSet params, DifferentiableSequenceScore... score)
          This convenience constructor creates an MSPClassifier that used MCL principle for training.
MSPClassifier(GenDisMixClassifierParameterSet params, LogPrior prior, DifferentiableSequenceScore... score)
          The default constructor that creates a new MSPClassifier from a given parameter set, a prior and DifferentiableSequenceScores for the classes.
MSPClassifier(GenDisMixClassifierParameterSet params, LogPrior prior, double lastScore, DifferentiableSequenceScore... score)
          This constructor that creates a new MSPClassifier from a given parameter set, a prior and DifferentiableSequenceScores for the classes.
MSPClassifier(StringBuffer xml)
          This is the constructor for Storable.
 
Method Summary
 String getInstanceName()
          Returns a short description of the classifier.
protected  String getXMLTag()
          Returns the String that is used as tag for the XML representation of the classifier.
 
Methods inherited from class de.jstacs.classifiers.differentiableSequenceScoreBased.gendismix.GenDisMixClassifier
clone, create, extractFurtherClassifierInfosFromXML, getFunction, getFurtherClassifierInfos, getNumberOfThreads, setNumberOfThreads, setPrior, setWeights, toString
 
Methods inherited from class de.jstacs.classifiers.differentiableSequenceScoreBased.ScoreClassifier
createStructure, createStructure, doOptimization, getClassifierAnnotation, getCurrentParameterSet, getDifferentiableSequenceScore, getDifferentiableSequenceScores, getLastScore, getNumericalCharacteristics, getScore, hasBeenOptimized, initUsingParameters, isInitialized, preoptimize, setOutputStream, train
 
Methods inherited from class de.jstacs.classifiers.AbstractScoreBasedClassifier
check, check, classify, classify, createDefaultClassWeights, getClassWeight, getClassWeights, getMultiClassScores, getNumberOfClasses, getPValue, getPValue, getResults, getScore, getScores, setClassWeights, setClassWeights, setThresholdClassWeights
 
Methods inherited from class de.jstacs.classifiers.AbstractClassifier
classify, evaluate, evaluate, getAlphabetContainer, getCharacteristics, getLength, toXML, train
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MSPClassifier

public MSPClassifier(GenDisMixClassifierParameterSet params,
                     DifferentiableSequenceScore... score)
              throws CloneNotSupportedException
This convenience constructor creates an MSPClassifier that used MCL principle for training.

Parameters:
params - the parameter set for the classifier
score - the DifferentiableSequenceScores for the classes
Throws:
CloneNotSupportedException - if at least one DifferentiableSequenceScore could not be cloned
See Also:
DoesNothingLogPrior, MSPClassifier(GenDisMixClassifierParameterSet, LogPrior, DifferentiableSequenceScore...)

MSPClassifier

public MSPClassifier(GenDisMixClassifierParameterSet params,
                     LogPrior prior,
                     DifferentiableSequenceScore... score)
              throws CloneNotSupportedException
The default constructor that creates a new MSPClassifier from a given parameter set, a prior and DifferentiableSequenceScores for the classes.

Parameters:
params - the parameter set for the classifier
prior - the prior that shall be used; the learning principle depends on the prior: if the prior is null or DoesNothingLogPrior then MCL is used otherwise MSP
score - the DifferentiableSequenceScores for the classes
Throws:
CloneNotSupportedException - if at least one DifferentiableSequenceScore could not be cloned
See Also:
MSPClassifier(GenDisMixClassifierParameterSet, LogPrior, double, DifferentiableSequenceScore...), ScoreClassifier.NOT_TRAINED_VALUE, GenDisMixClassifier.setPrior(LogPrior)

MSPClassifier

public MSPClassifier(GenDisMixClassifierParameterSet params,
                     LogPrior prior,
                     double lastScore,
                     DifferentiableSequenceScore... score)
              throws CloneNotSupportedException
This constructor that creates a new MSPClassifier from a given parameter set, a prior and DifferentiableSequenceScores for the classes. Additionally, the value lastScore can be set to determine the return value of ScoreClassifier.getLastScore(). This might be useful if the parameters of the classifier are determined by an external procedure.

Parameters:
params - the parameter set for the classifier
prior - the prior that shall be used; the learning principle depends on the prior: if the prior is null or DoesNothingLogPrior then MCL is used otherwise MSP
lastScore - the score of the last optimization
score - the DifferentiableSequenceScores for the classes
Throws:
CloneNotSupportedException - if at least one DifferentiableSequenceScore could not be cloned
See Also:
GenDisMixClassifier.GenDisMixClassifier(GenDisMixClassifierParameterSet, LogPrior, LearningPrinciple, de.jstacs.sequenceScores.statisticalModels.differentiable.DifferentiableStatisticalModel...), LearningPrinciple.MSP, GenDisMixClassifier.setPrior(LogPrior)

MSPClassifier

public MSPClassifier(StringBuffer xml)
              throws NonParsableException
This is the constructor for Storable.

Parameters:
xml - the xml representation
Throws:
NonParsableException - if the representation could not be parsed.
Method Detail

getXMLTag

protected String getXMLTag()
Description copied from class: AbstractClassifier
Returns the String that is used as tag for the XML representation of the classifier. This method is used by the methods AbstractClassifier.fromXML(StringBuffer) and AbstractClassifier.toXML().

Overrides:
getXMLTag in class GenDisMixClassifier
Returns:
the String that is used as tag for the XML representation of the classifier

getInstanceName

public String getInstanceName()
Description copied from class: AbstractClassifier
Returns a short description of the classifier.

Overrides:
getInstanceName in class GenDisMixClassifier
Returns:
a short description of the classifier