public class SamplingGenDisMixClassifier extends SamplingScoreBasedClassifier
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.SamplingScoreBasedClassifier.DiffSMSamplingComponent, SamplingScoreBasedClassifier.SamplingSchemeAbstractScoreBasedClassifier.DoubleTableResultburnInTest, currentParameters, currentScore, initParameters, lastParameters, lastScore, params, previousParameters, scoringFunctions| Constructor and Description |
|---|
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 |
| Modifier and Type | Method and Description |
|---|---|
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[][]). |
doOneSamplingStep, doSingleSampling, getBestParameters, getClassifierAnnotation, getDeleteOnExit, getInstanceName, getMeanParameters, getNumericalCharacteristics, getSamplingComponent, getScore, getScores, getTempDir, init, isInitialized, joinAndSetParameterFiles, precomputeBurnInLength, sample, sampleNSteps, setDeleteOnExit, setInitParameters, setTempDir, traincheck, check, classify, classify, clone, createDefaultClassWeights, getClassWeight, getClassWeights, getMultiClassScores, getNumberOfClasses, getPValue, getPValue, getResults, getScore, setClassWeights, setClassWeights, setThresholdClassWeightsclassify, evaluate, evaluate, getAlphabetContainer, getCharacteristics, getLength, toXML, trainpublic 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 LogGenDisMixFunctionscoringFunctions - the scoring functions for the different classesCloneNotSupportedException - 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 classesCloneNotSupportedException - if the scoring functions could not be clonedpublic SamplingGenDisMixClassifier(StringBuffer xml) throws NonParsableException
SamplingGenDisMixClassifier from its XML-representationxml - the XML-representationNonParsableException - if xml could not be parsedprotected DiffSSBasedOptimizableFunction getFunction(DataSet[] data, double[][] weights) throws Exception
SamplingScoreBasedClassifiergetFunction in class SamplingScoreBasedClassifierdata - the samplesweights - the weights of the sequences of the samplesException - if the function could not be createdprotected double modifyFunctionValue(double value)
SamplingScoreBasedClassifierSamplingScoreBasedClassifier.getFunction(DataSet[], double[][]).
This is for instance necessary in case of LogGenDisMixFunction to
obtain a proper posterior or supervised posterior.modifyFunctionValue in class SamplingScoreBasedClassifiervalue - the original valueprotected String getXMLTag()
AbstractClassifierString 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 AbstractClassifierString that is used as tag for the XML representation
of the classifierprotected StringBuffer getFurtherClassifierInfos()
AbstractClassifierStringBuffer. This method is used by the method AbstractClassifier.toXML()
and should not be made public.getFurtherClassifierInfos in class SamplingScoreBasedClassifierStringBufferAbstractClassifier.toXML()protected void extractFurtherClassifierInfosFromXML(StringBuffer xml) throws NonParsableException
AbstractClassifierAbstractClassifier.fromXML(StringBuffer) and
should not be made public.extractFurtherClassifierInfosFromXML in class SamplingScoreBasedClassifierxml - the XML representation as StringBufferNonParsableException - 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 GenDisMixClassifierGenDisMixClassifier with set parameter valuesException - 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 GenDisMixClassifiertestBurnIn - if burn-in phase is tested, otherwise parameters starting from index minBurnInSteps are consideredminBurnInSteps - the minimum number of steps before the stationary phaseGenDisMixClassifier with set parameter valuesException - if the GenDisMixClassifier could not be created