Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## de.jstacs.models.discrete.inhomogeneous.shared
Class SharedStructureClassifier

    java.lang.Object
      de.jstacs.classifier.AbstractClassifier
          de.jstacs.classifier.AbstractScoreBasedClassifier
              de.jstacs.classifier.modelBased.ModelBasedClassifier
                  de.jstacs.models.discrete.inhomogeneous.shared.SharedStructureClassifier

All Implemented Interfaces:
  Storable, Cloneable

    public class SharedStructureClassifier

extends ModelBasedClassifier

This class enables you to learn the structure on all classes of the classifier together. A special case is, for instance, a Tree Augmented Naive Bayes (TAN).

Author:
  Jens Keilwagen

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)` Creates a new `SharedStructureClassifier` from given `FSDAGModel`s.
`SharedStructureClassifier(StringBuffer xml)` The standard constructor for the interface `Storable`.

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 `Result`s of dimension `AbstractClassifier.getNumberOfClasses()` that contains information about 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, 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

### SharedStructureClassifier

    public SharedStructureClassifier(int length,
                                     StructureLearner.ModelType model,
                                     byte order,
                                     StructureLearner.LearningType method,
                                     FSDAGModel... models)
                              throws IllegalArgumentException,
                                     CloneNotSupportedException,
                                     ClassDimensionException

  Creates a new `SharedStructureClassifier` from given `FSDAGModel`s. This is the main constructor.

  Parameters:
    `length` - the sequence length
    `model` - the type of the model
    `order` - the order of the model
    `method` - the learning method
    `models` - the class models
  Throws:
    `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)
  See Also:
    `StructureLearner.ModelType`, `StructureLearner.LearningType`, `ModelBasedClassifier.ModelBasedClassifier(boolean,de.jstacs.models.Model[])`

### SharedStructureClassifier

    public SharedStructureClassifier(StringBuffer xml)
                              throws NonParsableException

  The standard constructor for the interface `Storable`. Creates a new `SharedStructureClassifier` out of its XML representation.

  Parameters:
    `xml` - the XML representation as `StringBuffer`
  Throws:
    `NonParsableException` - if the `SharedStructureClassifier` could not be reconstructed out of the XML representation (the `StringBuffer` could not be parsed)
  See Also:
    `Storable`, `ModelBasedClassifier.ModelBasedClassifier(StringBuffer)`

Method Detail

### clone

    public SharedStructureClassifier clone()
                                    throws CloneNotSupportedException

  Overrides:
    `clone` in class `ModelBasedClassifier`
  Throws:
    `CloneNotSupportedException`

### train

    public void train(Sample[] data,
                      double[][] weights)
               throws IllegalArgumentException,
                      Exception

  Description copied from class: `AbstractClassifier`
  This method trains a classifier over an array of weighted `Sample` s. That is why the following has to be fulfilled:
  - `s.length == weights.length`
  - and for all i: `weights[i] == null || s[i].getNumberOfElements() == weights[i].length`.
  This method should work non-incrementally as the method `AbstractClassifier.train(Sample...)`.
  This method should check that the `Sample`s are defined over the underlying alphabet and length.

  Overrides:
    `train` in class `ModelBasedClassifier`
  Parameters:
    `data` - an array of `Sample`s
    `weights` - the weights for the `Sample`s
  Throws:
    `Exception` - if the weights are incorrect or the training did not succeed
    `IllegalArgumentException`
  See Also:
    `AbstractClassifier.train(Sample...)`

### getInstanceName

    public String getInstanceName()

  Description copied from class: `AbstractClassifier`
  Returns a short description of the classifier.

  Overrides:
    `getInstanceName` in class `ModelBasedClassifier`
  Returns:
    a short description of the classifier

### extractFurtherClassifierInfosFromXML

    protected void extractFurtherClassifierInfosFromXML(StringBuffer xml)
                                                 throws NonParsableException

  Description copied from class: `AbstractClassifier`
  Extracts further information of a classifier from an XML representation. This method is used by the method `AbstractClassifier.fromXML(StringBuffer)` and should not be made public.

  Overrides:
    `extractFurtherClassifierInfosFromXML` in class `ModelBasedClassifier`
  Parameters:
    `xml` - the XML representation as `StringBuffer`
  Throws:
    `NonParsableException` - if the information could not be parsed out of the XML representation (the `StringBuffer` could not be parsed)
  See Also:
    `AbstractClassifier.fromXML(StringBuffer)`

### getFurtherClassifierInfos

    protected StringBuffer getFurtherClassifierInfos()

  Description copied from class: `AbstractClassifier`
  This method returns further information of a classifier as a `StringBuffer`. This method is used by the method `AbstractClassifier.toXML()` and should not be made public.

  Overrides:
    `getFurtherClassifierInfos` in class `ModelBasedClassifier`
  Returns:
    further information of a classifier as a `StringBuffer`
  See Also:
    `AbstractClassifier.toXML()`

### getClassifierAnnotation

    public CategoricalResult[] getClassifierAnnotation()

  Description copied from class: `AbstractClassifier`
  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() );
  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" );
  ...`

  Overrides:
    `getClassifierAnnotation` in class `ModelBasedClassifier`
  Returns:
    an array of `Result`s that contains information about the classifier

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD