public class SharedStructureClassifier extends TrainSMBasedClassifier
AbstractScoreBasedClassifier.DoubleTableResult
models
Constructor and Description |
---|
SharedStructureClassifier(int length,
StructureLearner.ModelType model,
byte order,
StructureLearner.LearningType method,
FSDAGTrainSM... models)
Creates a new
SharedStructureClassifier from given
FSDAGTrainSM s. |
SharedStructureClassifier(StringBuffer xml)
The standard constructor for the interface
Storable . |
Modifier and Type | Method and Description |
---|---|
SharedStructureClassifier |
clone() |
protected void |
extractFurtherClassifierInfosFromXML(StringBuffer xml)
Extracts further information of a classifier from an XML representation.
|
CategoricalResult[] |
getClassifierAnnotation()
Returns an array of Result s of dimension
AbstractClassifier.getNumberOfClasses() that contains information about the
classifier and for each class.
res[0] = new CategoricalResult( "classifier", "the kind of classifier", getInstanceName() );
|
protected StringBuffer |
getFurtherClassifierInfos()
This method returns further information of a classifier as a
StringBuffer . |
String |
getInstanceName()
Returns a short description of the classifier.
|
void |
train(DataSet[] data,
double[][] weights)
This method trains a classifier over an array of weighted
DataSet
s. |
classify, getCharacteristics, getLogLikelihoodRatio, getModel, getNumericalCharacteristics, getPossibleLength, getScore, getScores, getXMLTag, isInitialized, toString
check, check, classify, classify, createDefaultClassWeights, getClassWeight, getClassWeights, getMultiClassScores, getNumberOfClasses, getPValue, getPValue, getResults, getScore, setClassWeights, setClassWeights, setThresholdClassWeights
evaluate, evaluate, getAlphabetContainer, getLength, toXML, train
public SharedStructureClassifier(int length, StructureLearner.ModelType model, byte order, StructureLearner.LearningType method, FSDAGTrainSM... models) throws IllegalArgumentException, CloneNotSupportedException, ClassDimensionException
SharedStructureClassifier
from given
FSDAGTrainSM
s. This is the main constructor.length
- the sequence lengthmodel
- the type of the modelorder
- the order of the modelmethod
- the learning methodmodels
- the class modelsIllegalArgumentException
- if order
is below 0CloneNotSupportedException
- if at least one model could not be clonedClassDimensionException
- if the class dimension is wrong (below 2)StructureLearner.ModelType
,
StructureLearner.LearningType
,
TrainSMBasedClassifier.TrainSMBasedClassifier(boolean, de.jstacs.sequenceScores.statisticalModels.trainable.TrainableStatisticalModel...)
public SharedStructureClassifier(StringBuffer xml) throws NonParsableException
Storable
.
Creates a new SharedStructureClassifier
out of its XML
representation.xml
- the XML representation as StringBuffer
NonParsableException
- if the SharedStructureClassifier
could not be
reconstructed out of the XML representation (the
StringBuffer
could not be parsed)Storable
,
TrainSMBasedClassifier.TrainSMBasedClassifier(StringBuffer)
public SharedStructureClassifier clone() throws CloneNotSupportedException
clone
in class TrainSMBasedClassifier
CloneNotSupportedException
public void train(DataSet[] data, double[][] weights) throws IllegalArgumentException, Exception
AbstractClassifier
DataSet
s. That is why the following has to be fulfilled:
s.length == weights.length
weights[i] == null || s[i].getNumberOfElements() == weights[i].length
.
AbstractClassifier.train(DataSet...)
.
DataSet
s are defined over the
underlying alphabet and length.train
in class TrainSMBasedClassifier
data
- an array of DataSet
sweights
- the weights for the DataSet
sException
- if the weights are incorrect or the training did not succeedIllegalArgumentException
AbstractClassifier.train(DataSet...)
public String getInstanceName()
AbstractClassifier
getInstanceName
in class TrainSMBasedClassifier
protected void extractFurtherClassifierInfosFromXML(StringBuffer xml) throws NonParsableException
AbstractClassifier
AbstractClassifier.fromXML(StringBuffer)
and
should not be made public.extractFurtherClassifierInfosFromXML
in class TrainSMBasedClassifier
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)
protected StringBuffer getFurtherClassifierInfos()
AbstractClassifier
StringBuffer
. This method is used by the method AbstractClassifier.toXML()
and should not be made public.getFurtherClassifierInfos
in class TrainSMBasedClassifier
StringBuffer
AbstractClassifier.toXML()
public CategoricalResult[] getClassifierAnnotation()
AbstractClassifier
Result
s of dimension
AbstractClassifier.getNumberOfClasses()
that contains information about the
classifier and for each class.
res[0] = new CategoricalResult( "classifier", "the kind of classifier", getInstanceName() );
res[1] = new CategoricalResult( "class info 0", "some information about the class", "info0" );
res[2] = new CategoricalResult( "class info 1", "some information about the class", "info1" );
...
getClassifierAnnotation
in class TrainSMBasedClassifier
Result
s that contains information about the
classifier