public class GenDisMixClassifier extends ScoreClassifier
LearningPrinciple
,
LogGenDisMixFunction
AbstractScoreBasedClassifier.DoubleTableResult
Modifier and Type | Field and Description |
---|---|
protected double[] |
beta
The weights that determine a point of the simplex that corresponds to the function that is optimized by this classifier.
|
protected LogGenDisMixFunction |
function
The function that is optimized in this classifier.
|
protected LogPrior |
prior
The prior that is used in this classifier.
|
hasBeenOptimized, NOT_TRAINED_VALUE, params, score, sostream, template
Constructor and Description |
---|
GenDisMixClassifier(GenDisMixClassifierParameterSet params,
LogPrior prior,
double[] beta,
DifferentiableStatisticalModel... score)
The main constructor.
|
GenDisMixClassifier(GenDisMixClassifierParameterSet params,
LogPrior prior,
double lastScore,
double[] beta,
DifferentiableSequenceScore... score)
This constructor creates an instance and sets the value of the last (external) optimization.
|
GenDisMixClassifier(GenDisMixClassifierParameterSet params,
LogPrior prior,
double lastScore,
double[] beta,
DifferentiableStatisticalModel... score)
This constructor creates an instance and sets the value of the last (external) optimization.
|
GenDisMixClassifier(GenDisMixClassifierParameterSet params,
LogPrior prior,
double genBeta,
double disBeta,
double priorBeta,
DifferentiableStatisticalModel... score)
This convenience constructor agglomerates the
genBeta, disBeta, and priorBeta into an array and calls the main constructor. |
GenDisMixClassifier(GenDisMixClassifierParameterSet params,
LogPrior prior,
LearningPrinciple key,
DifferentiableStatisticalModel... score)
This convenience constructor creates an array of weights for an elementary learning principle and calls the main constructor.
|
GenDisMixClassifier(StringBuffer xml)
This is the constructor for
Storable . |
Modifier and Type | Method and Description |
---|---|
GenDisMixClassifier |
clone() |
static GenDisMixClassifier[] |
create(GenDisMixClassifierParameterSet params,
LogPrior prior,
double[] weights,
DifferentiableStatisticalModel[]... functions)
This method creates an array of GenDisMixClassifiers by using the cross-product of the given
DifferentiableStatisticalModel s. |
protected void |
extractFurtherClassifierInfosFromXML(StringBuffer xml)
Extracts further information of a classifier from an XML representation.
|
protected LogGenDisMixFunction |
getFunction(DataSet[] data,
double[][] weights)
Returns the function that should be optimized.
|
protected StringBuffer |
getFurtherClassifierInfos()
This method returns further information of a classifier as a
StringBuffer . |
String |
getInstanceName()
Returns a short description of the classifier.
|
int |
getNumberOfThreads()
This method returns the number of used threads while optimization.
|
protected String |
getXMLTag()
Returns the
String that is used as tag for the XML representation
of the classifier. |
void |
setNumberOfThreads(int threads)
This method allows to set the number of threads used while optimization.
|
void |
setPrior(LogPrior prior)
This method set a new prior that should be used for optimization.
|
void |
setWeights(double... beta)
This method set the weights for the summand of the function.
|
String |
toString() |
createStructure, createStructure, doOptimization, getClassifierAnnotation, getCurrentParameterSet, getDifferentiableSequenceScore, getDifferentiableSequenceScores, getIterations, getLastScore, getNumericalCharacteristics, getScore, hasBeenOptimized, initUsingParameters, isInitialized, preoptimize, setOutputStream, train
check, check, classify, classify, createDefaultClassWeights, getClassWeight, getClassWeights, getMultiClassScores, getNumberOfClasses, getPValue, getPValue, getResults, getScore, getScores, setClassWeights, setClassWeights, setThresholdClassWeights
classify, evaluate, evaluate, getAlphabetContainer, getCharacteristics, getLength, toXML, train
protected LogPrior prior
protected LogGenDisMixFunction function
protected double[] beta
public GenDisMixClassifier(GenDisMixClassifierParameterSet params, LogPrior prior, double lastScore, double[] beta, DifferentiableSequenceScore... score) throws CloneNotSupportedException
params
- the common parametersprior
- the prior for the parameters of the classifierlastScore
- the score of the last optimizationbeta
- the weights for log likelihood, log conditional likelihood and log priorscore
- the functions for the classesCloneNotSupportedException
- if an instance could not be clonepublic GenDisMixClassifier(GenDisMixClassifierParameterSet params, LogPrior prior, double lastScore, double[] beta, DifferentiableStatisticalModel... score) throws CloneNotSupportedException
params
- the common parametersprior
- the prior for the parameters of the classifierlastScore
- the score of the last optimizationbeta
- the weights for log likelihood, log conditional likelihood and log priorscore
- the functions for the classesCloneNotSupportedException
- if an instance could not be clonepublic GenDisMixClassifier(GenDisMixClassifierParameterSet params, LogPrior prior, double[] beta, DifferentiableStatisticalModel... score) throws CloneNotSupportedException
params
- the common parametersprior
- the prior for the parameters of the classifierbeta
- the weights for log likelihood, log conditional likelihood and log priorscore
- the functions for the classesCloneNotSupportedException
- if an instance could not be clonepublic GenDisMixClassifier(GenDisMixClassifierParameterSet params, LogPrior prior, double genBeta, double disBeta, double priorBeta, DifferentiableStatisticalModel... score) throws CloneNotSupportedException
genBeta, disBeta,
and priorBeta
into an array and calls the main constructor.params
- the common parametersprior
- the prior for the parameters of the classifiergenBeta
- the weight for the log likelihooddisBeta
- the weight for the log conditional likelihoodpriorBeta
- the weight for the log priorscore
- the functions for the classesCloneNotSupportedException
- if an instance could not be clonepublic GenDisMixClassifier(GenDisMixClassifierParameterSet params, LogPrior prior, LearningPrinciple key, DifferentiableStatisticalModel... score) throws CloneNotSupportedException
params
- the common parametersprior
- the prior for the parameters of the classifierkey
- the key for an elementary LearningPrinciple
score
- the functions for the classesCloneNotSupportedException
- if an instance could not be cloneLearningPrinciple.getBeta(LearningPrinciple)
public GenDisMixClassifier(StringBuffer xml) throws NonParsableException
Storable
.xml
- the xml representationNonParsableException
- if the representation could not be parsed.public GenDisMixClassifier clone() throws CloneNotSupportedException
clone
in class ScoreClassifier
CloneNotSupportedException
protected LogGenDisMixFunction getFunction(DataSet[] data, double[][] weights) throws Exception
ScoreClassifier
getFunction
in class ScoreClassifier
data
- the data setsweights
- the weights of the sequences of the data setsException
- if something went wrongpublic void setPrior(LogPrior prior)
isTrained
will return false
after invoking this method.prior
- the new priorpublic void setWeights(double... beta) throws IllegalArgumentException
isTrained
will return false
after invoking this method.beta
- the weightsIllegalArgumentException
- if the weights array is not correctLearningPrinciple.getBeta(LearningPrinciple)
protected String getXMLTag()
AbstractClassifier
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()
.getXMLTag
in class ScoreClassifier
String
that is used as tag for the XML representation
of the classifierprotected StringBuffer getFurtherClassifierInfos()
AbstractClassifier
StringBuffer
. This method is used by the method AbstractClassifier.toXML()
and should not be made public.getFurtherClassifierInfos
in class ScoreClassifier
StringBuffer
AbstractClassifier.toXML()
protected void extractFurtherClassifierInfosFromXML(StringBuffer xml) throws NonParsableException
AbstractClassifier
AbstractClassifier.fromXML(StringBuffer)
and
should not be made public.extractFurtherClassifierInfosFromXML
in class ScoreClassifier
xml
- the XML representation as StringBuffer
NonParsableException
- if the information could not be parsed out of the XML
representation (the StringBuffer
could not be parsed)AbstractClassifier.fromXML(StringBuffer)
public static GenDisMixClassifier[] create(GenDisMixClassifierParameterSet params, LogPrior prior, double[] weights, DifferentiableStatisticalModel[]... functions) throws CloneNotSupportedException
DifferentiableStatisticalModel
s.params
- the parameters that will be used in all classifiersprior
- the prior that will be used in all classifiersweights
- the weights that will be used in all classifiersfunctions
- the DifferentiableStatisticalModel
s
DifferentiableStatisticalModel
s that can be used for class i
CloneNotSupportedException
- if the some item could not be clonedGenDisMixClassifier(GenDisMixClassifierParameterSet, LogPrior, double[],
DifferentiableStatisticalModel[])
public String getInstanceName()
AbstractClassifier
getInstanceName
in class ScoreClassifier
public int getNumberOfThreads()
public void setNumberOfThreads(int threads) throws SimpleParameter.IllegalValueException
threads
- the number of threadsSimpleParameter.IllegalValueException
- if the number of threads is not possible