|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jstacs.classifier.AbstractClassifier
de.jstacs.classifier.AbstractScoreBasedClassifier
de.jstacs.classifier.modelBased.ModelBasedClassifier
de.jstacs.models.discrete.inhomogeneous.shared.SharedStructureClassifier
public class SharedStructureClassifier
This class enables you to learn the structure on all classes together. A special case is for instance a TAN.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class de.jstacs.classifier.AbstractScoreBasedClassifier |
---|
AbstractScoreBasedClassifier.DoubleTableResult |
Field Summary |
---|
Fields inherited from class de.jstacs.classifier.modelBased.ModelBasedClassifier |
---|
models |
Constructor Summary | |
---|---|
SharedStructureClassifier(int length,
StructureLearner.ModelType model,
byte order,
StructureLearner.LearningType method,
FSDAGModel... models)
The main constructor. |
|
SharedStructureClassifier(StringBuffer xml)
The constructor for the Storable interface. |
Method Summary | |
---|---|
SharedStructureClassifier |
clone()
|
protected void |
extractFurtherClassifierInfosFromXML(StringBuffer xml)
Extracts further information of a classifier from an xml-representation. |
CategoricalResult[] |
getClassifierAnnotation()
Returns an array of Results of dimension getNumberOfClasses that contains information the
classifier and for each class. |
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(Sample[] data,
double[][] weights)
This method trains a classifier over an array of weighted Sample s. |
Methods inherited from class de.jstacs.classifier.modelBased.ModelBasedClassifier |
---|
classify, getCharacteristics, getModel, getNumericalCharacteristics, getPossibleLength, getScore, getScores, getXMLTag, isTrained, setNewAlphabetContainerInstance |
Methods inherited from class de.jstacs.classifier.AbstractScoreBasedClassifier |
---|
check, check, classify, classify, createDefaultClassWeights, getClassWeight, getClassWeights, getNumberOfClasses, getPValue, getPValue, getResults, getScore, setClassWeights, setThresholdClassWeights, test |
Methods inherited from class de.jstacs.classifier.AbstractClassifier |
---|
evaluate, evaluateAll, getAlphabetContainer, getClassificationRate, getLength, getMeasuresForEvaluate, getMeasuresForEvaluateAll, toXML, train |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SharedStructureClassifier(int length, StructureLearner.ModelType model, byte order, StructureLearner.LearningType method, FSDAGModel... models) throws IllegalArgumentException, CloneNotSupportedException, ClassDimensionException
length
- the sequence lengthmodel
- the model typeorder
- the model ordermethod
- the learning methodmodels
- the class models
IllegalArgumentException
- if order is below 0
CloneNotSupportedException
- if at least one model could not be cloned
ClassDimensionException
- if the class dimension is wrong (below 2)public SharedStructureClassifier(StringBuffer xml) throws NonParsableException
Storable
interface.
xml
- the StringBuffer
NonParsableException
- if the StringBuffer is not parsableMethod Detail |
---|
public SharedStructureClassifier clone() throws CloneNotSupportedException
clone
in class ModelBasedClassifier
CloneNotSupportedException
public void train(Sample[] data, double[][] weights) throws IllegalArgumentException, Exception
AbstractClassifier
Sample
s. That's why the following has
to be fulfilled:
s.length == weights.length
weights[i] == null || s[i].getNumberOfElements() == weights[i].length
.
train( Sample[] )
.
Sample
s are defined over the underlying alphabet and length.
train
in class ModelBasedClassifier
data
- an array of Sample
sweights
- the weights for s
Exception
- an Exception should be thrown if the weights are incorrect or the training did not succeed
IllegalArgumentException
public String getInstanceName()
AbstractClassifier
getInstanceName
in class ModelBasedClassifier
protected void extractFurtherClassifierInfosFromXML(StringBuffer xml) throws NonParsableException
AbstractClassifier
fromXML( StringBuffer )
and should not be made public.
extractFurtherClassifierInfosFromXML
in class ModelBasedClassifier
xml
- the xml-representation
NonParsableException
protected StringBuffer getFurtherClassifierInfos()
AbstractClassifier
toXML()
and should not be made public.
getFurtherClassifierInfos
in class ModelBasedClassifier
public CategoricalResult[] getClassifierAnnotation()
AbstractClassifier
getNumberOfClasses
that contains information 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 ModelBasedClassifier
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |