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
Class StructureLearner

    java.lang.Object
      de.jstacs.models.discrete.inhomogeneous.StructureLearner

    public class StructureLearner

extends Object

This class can be used to learn the structure of any discrete model.

Author:
  Jens Keilwagen

Nested Class Summary
`static class` | `StructureLearner.LearningType` This enum defines the different types of learning that are possible with the `StructureLearner`.
`static class` | `StructureLearner.ModelType` This enum defines the different types of models that can be learned with the `StructureLearner`.

Constructor Summary
`StructureLearner(AlphabetContainer con, int length)` Creates a StructureLearner with ess = 0.
`StructureLearner(AlphabetContainer con, int length, double ess)` Creates a StructureLearner

Method Summary
`AlphabetContainer` | `getAlphabetContainer()` This method returns the AlphabetContainer of the StructureLearner.
`double` | `getEss()` This method returns the ESS of the StructureLearner.
`int[][]` | `getStructure(Sample data, double[] weights, StructureLearner.ModelType model, byte order, StructureLearner.LearningType method)` This method finds the optimal structure (in some sense).
`static int[][]` | `getStructure(Tensor t, StructureLearner.ModelType model, byte order)` This method can be used to determine the optimal structure.
`SymmetricTensor` | `getTensor(Sample data, double[] weights, byte order, StructureLearner.LearningType method)` This method can be used to compute a tensor that can be used to determine the optimal structure.
`void` | `setESS(double ess)` This method sets the ESS of the StructureLearner.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### StructureLearner

    public StructureLearner(AlphabetContainer con,
                            int length,
                            double ess)
                     throws IllegalArgumentException

  Creates a StructureLearner

  Parameters:
    `con` - the alphabets this instance should use
    `length` - the length
    `ess` - the ess (has to be non-negative)
  Throws:
    `IllegalArgumentException` - if the AlphabetContainer is not discrete, the length is not matching with the AlphabetContainer or the ess is below 0

### StructureLearner

    public StructureLearner(AlphabetContainer con,
                            int length)
                     throws IllegalArgumentException

  Creates a StructureLearner with ess = 0.

  Parameters:
    `con` -
    `length` -
  Throws:
    `IllegalArgumentException` - if the AlphabetContainer is not discrete or the length is not matching with the AlphabetContainer
  See Also:
    `StructureLearner(AlphabetContainer, int, double)`

Method Detail

### getAlphabetContainer

    public AlphabetContainer getAlphabetContainer()

  This method returns the AlphabetContainer of the StructureLearner.

  Returns:
    the AlphabetContainer of the StructureLearner

### getEss

    public double getEss()

  This method returns the ESS of the StructureLearner.

  Returns:
    the ESS of the StructureLearner

### setESS

    public void setESS(double ess)
                throws IllegalArgumentException

  This method sets the ESS of the StructureLearner.

  Parameters:
    `ess` - the SS of the StructureLearner
  Throws:
    `IllegalArgumentException` - if the `ess` is below 0

### getStructure

    public int[][] getStructure(Sample data,
                                double[] weights,
                                StructureLearner.ModelType model,
                                byte order,
                                StructureLearner.LearningType method)
                         throws Exception

  This method finds the optimal structure (in some sense).

  Parameters:
    `data` - the Sample
    `weights` - the weights
    `model` - the kind of model
    `order` - the markov order
    `method` - the learning method
  Returns:
    the structure of the specified model
  Throws:
    `Exception` - if something went wrong

### getStructure

    public static int[][] getStructure(Tensor t,
                                       StructureLearner.ModelType model,
                                       byte order)
                                throws Exception

  This method can be used to determine the optimal structure.

  Parameters:
    `t` - the tensor containing all relevant weights
    `model` - the model type
    `order` - the model order
  Returns:
    the structure
  Throws:
    `Exception` - if something in the algorithm went wrong

### getTensor

    public SymmetricTensor getTensor(Sample data,
                                     double[] weights,
                                     byte order,
                                     StructureLearner.LearningType method)
                              throws IllegalArgumentException,
                                     WrongAlphabetException

  This method can be used to compute a tensor that can be used to determine the optimal structure.

  Parameters:
    `data` - the data
    `weights` - the weights
    `order` - the markov order
    `method` - the learning type
  Returns:
    a tensor containing all values the are necessary to determine the optimal structure
  Throws:
    `IllegalArgumentException`
    `WrongAlphabetException` - if the AlphabetContainer of the data is not correct

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