|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jstacs.classifiers.AbstractClassifier
de.jstacs.classifiers.AbstractScoreBasedClassifier
de.jstacs.classifiers.differentiableSequenceScoreBased.sampling.SamplingScoreBasedClassifier
de.jstacs.classifiers.differentiableSequenceScoreBased.sampling.SamplingGenDisMixClassifier
public class SamplingGenDisMixClassifier
A classifier that samples its parameters from a LogGenDisMixFunction
using the
Metropolis-Hastings algorithm. For details on the algorithm see SamplingScoreBasedClassifier
.
The LogGenDisMixFunction
includes several known posterior distributions, including the posterior (LearningPrinciple.MAP
)
and the supervised posterior (LearningPrinciple.MSP
). For non-uniform values of the mixture parameters beta
the distribution
we sample from is less well defined, although sampling is possible in general.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class de.jstacs.classifiers.differentiableSequenceScoreBased.sampling.SamplingScoreBasedClassifier |
---|
SamplingScoreBasedClassifier.DiffSMSamplingComponent, SamplingScoreBasedClassifier.SamplingScheme |
Nested classes/interfaces inherited from class de.jstacs.classifiers.AbstractScoreBasedClassifier |
---|
AbstractScoreBasedClassifier.DoubleTableResult |
Field Summary |
---|
Fields inherited from class de.jstacs.classifiers.differentiableSequenceScoreBased.sampling.SamplingScoreBasedClassifier |
---|
burnInTest, currentParameters, currentScore, initParameters, lastParameters, lastScore, params, previousParameters, scoringFunctions |
Constructor Summary | |
---|---|
SamplingGenDisMixClassifier(SamplingGenDisMixClassifierParameterSet params,
BurnInTest burnInTest,
double[] classVariances,
LogPrior prior,
double[] beta,
SamplingDifferentiableStatisticalModel... scoringFunctions)
Creates a new SamplingGenDisMixClassifier using the external parameters
params , a burn-in test, a set of sampling variances for the different classes,
a prior on the parameters, weights beta for the three components of the
LogGenDisMixFunction , i.e., likelihood, conditional likelihood, and prior,
and scoring functions that model the distribution for each of the classes. |
|
SamplingGenDisMixClassifier(SamplingGenDisMixClassifierParameterSet params,
BurnInTest burnInTest,
double[] classVariances,
LogPrior prior,
LearningPrinciple principle,
SamplingDifferentiableStatisticalModel... scoringFunctions)
Creates a new SamplingGenDisMixClassifier using the external parameters
params , a burn-in test, a set of sampling variances for the different classes,
a prior on the parameters, a learning principle,
and scoring functions that model the distribution for each of the classes. |
|
SamplingGenDisMixClassifier(StringBuffer xml)
Creates a new SamplingGenDisMixClassifier from its XML-representation |
Method Summary | |
---|---|
protected void |
extractFurtherClassifierInfosFromXML(StringBuffer xml)
Extracts further information of a classifier from an XML representation. |
GenDisMixClassifier |
getClassifierForBestParameters(GenDisMixClassifierParameterSet params)
Returns a standard, i.e., non-sampling, GenDisMixClassifier , where the parameters
are set to those that yielded the maximum value of the objective functions among all sampled
parameter values. |
GenDisMixClassifier |
getClassifierForMeanParameters(GenDisMixClassifierParameterSet params,
boolean testBurnIn,
int minBurnInSteps)
Returns a standard, i.e., non-sampling, GenDisMixClassifier , where the parameters
are set to the mean values over all sampled
parameter values in the stationary phase. |
protected DiffSSBasedOptimizableFunction |
getFunction(DataSet[] data,
double[][] weights)
Returns the function that should be sampled from. |
protected StringBuffer |
getFurtherClassifierInfos()
This method returns further information of a classifier as a StringBuffer . |
protected String |
getXMLTag()
Returns the String that is used as tag for the XML representation
of the classifier. |
protected double |
modifyFunctionValue(double value)
Allows for a modification of the value returned by the function obtained by SamplingScoreBasedClassifier.getFunction(DataSet[], double[][]) . |
Methods inherited from class de.jstacs.classifiers.differentiableSequenceScoreBased.sampling.SamplingScoreBasedClassifier |
---|
doOneSamplingStep, doSingleSampling, getBestParameters, getClassifierAnnotation, getDeleteOnExit, getInstanceName, getMeanParameters, getNumericalCharacteristics, getSamplingComponent, getScore, getScores, getTempDir, init, isInitialized, joinAndSetParameterFiles, precomputeBurnInLength, sample, sampleNSteps, setDeleteOnExit, setInitParameters, setTempDir, train |
Methods inherited from class de.jstacs.classifiers.AbstractScoreBasedClassifier |
---|
check, check, classify, classify, clone, createDefaultClassWeights, getClassWeight, getClassWeights, getMultiClassScores, getNumberOfClasses, getPValue, getPValue, getResults, getScore, setClassWeights, setClassWeights, setThresholdClassWeights |
Methods inherited from class de.jstacs.classifiers.AbstractClassifier |
---|
classify, evaluate, getAlphabetContainer, getCharacteristics, getLength, toXML, train |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SamplingGenDisMixClassifier(SamplingGenDisMixClassifierParameterSet params, BurnInTest burnInTest, double[] classVariances, LogPrior prior, double[] beta, SamplingDifferentiableStatisticalModel... scoringFunctions) throws CloneNotSupportedException
SamplingGenDisMixClassifier
using the external parameters
params
, a burn-in test, a set of sampling variances for the different classes,
a prior on the parameters, weights beta
for the three components of the
LogGenDisMixFunction
, i.e., likelihood, conditional likelihood, and prior,
and scoring functions that model the distribution for each of the classes.
params
- the external parametersburnInTest
- the burn-in test, or null
for no burn-in testclassVariances
- the sampling variances for the parameters in the different classesprior
- the prior on the parametersbeta
- The weights of the three components of the LogGenDisMixFunction
scoringFunctions
- the scoring functions for the different classes
CloneNotSupportedException
- if the scoring functions could not be clonedpublic SamplingGenDisMixClassifier(SamplingGenDisMixClassifierParameterSet params, BurnInTest burnInTest, double[] classVariances, LogPrior prior, LearningPrinciple principle, SamplingDifferentiableStatisticalModel... scoringFunctions) throws CloneNotSupportedException
SamplingGenDisMixClassifier
using the external parameters
params
, a burn-in test, a set of sampling variances for the different classes,
a prior on the parameters, a learning principle,
and scoring functions that model the distribution for each of the classes.
params
- the external parametersburnInTest
- the burn-in test, or null
for no burn-in testclassVariances
- the sampling variances for the parameters in the different classesprior
- the prior on the parametersprinciple
- the learning principle, i.e., the objective function we sample fromscoringFunctions
- the scoring functions for the different classes
CloneNotSupportedException
- if the scoring functions could not be clonedpublic SamplingGenDisMixClassifier(StringBuffer xml) throws NonParsableException
SamplingGenDisMixClassifier
from its XML-representation
xml
- the XML-representation
NonParsableException
- if xml
could not be parsedMethod Detail |
---|
protected DiffSSBasedOptimizableFunction getFunction(DataSet[] data, double[][] weights) throws Exception
SamplingScoreBasedClassifier
getFunction
in class SamplingScoreBasedClassifier
data
- the samplesweights
- the weights of the sequences of the samples
Exception
- if the function could not be createdprotected double modifyFunctionValue(double value)
SamplingScoreBasedClassifier
SamplingScoreBasedClassifier.getFunction(DataSet[], double[][])
.
This is for instance necessary in case of LogGenDisMixFunction
to
obtain a proper posterior or supervised posterior.
modifyFunctionValue
in class SamplingScoreBasedClassifier
value
- the original value
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 AbstractClassifier
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 SamplingScoreBasedClassifier
StringBuffer
AbstractClassifier.toXML()
protected void extractFurtherClassifierInfosFromXML(StringBuffer xml) throws NonParsableException
AbstractClassifier
AbstractClassifier.fromXML(StringBuffer)
and
should not be made public.
extractFurtherClassifierInfosFromXML
in class SamplingScoreBasedClassifier
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 GenDisMixClassifier getClassifierForBestParameters(GenDisMixClassifierParameterSet params) throws Exception
GenDisMixClassifier
, where the parameters
are set to those that yielded the maximum value of the objective functions among all sampled
parameter values.
params
- the external parameters of the GenDisMixClassifier
GenDisMixClassifier
with set parameter values
Exception
- if the GenDisMixClassifier
could not be createdpublic GenDisMixClassifier getClassifierForMeanParameters(GenDisMixClassifierParameterSet params, boolean testBurnIn, int minBurnInSteps) throws Exception
GenDisMixClassifier
, where the parameters
are set to the mean values over all sampled
parameter values in the stationary phase.
params
- the external parameters of the GenDisMixClassifier
testBurnIn
- if burn-in phase is tested, otherwise parameters starting from index minBurnInSteps
are consideredminBurnInSteps
- the minimum number of steps before the stationary phase
GenDisMixClassifier
with set parameter values
Exception
- if the GenDisMixClassifier
could not be created
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |