public class StructureLearner extends Object
Modifier and Type | Class and Description |
---|---|
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 and Description |
---|
StructureLearner(AlphabetContainer con,
int length)
Creates a
StructureLearner with equivalent sample
size (ess) = 0. |
StructureLearner(AlphabetContainer con,
int length,
double ess)
Creates a new
StructureLearner for a given
AlphabetContainer , a given length and a given equivalent
sample size (ess). |
Modifier and Type | Method and Description |
---|---|
AlphabetContainer |
getAlphabetContainer()
This method returns the
AlphabetContainer of the
StructureLearner . |
double |
getEss()
This method returns the ess (equivalent sample size)
of the
StructureLearner . |
int[][] |
getStructure(DataSet data,
double[] weights,
StructureLearner.ModelType model,
byte order,
StructureLearner.LearningType method)
This method finds the optimal structure of a model by using a given
learning method (in some sense).
|
static int[][] |
getStructure(Tensor t,
StructureLearner.ModelType model,
byte order)
This method can be used to determine the optimal structure of a model.
|
SymmetricTensor |
getTensor(DataSet 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 (equivalent sample size) of
the
StructureLearner . |
public StructureLearner(AlphabetContainer con, int length, double ess) throws IllegalArgumentException
StructureLearner
for a given
AlphabetContainer
, a given length and a given equivalent
sample size (ess).con
- the alphabets this instance should uselength
- the lengthess
- the ess (equivalent sample size, has to
be non-negative)IllegalArgumentException
- if the AlphabetContainer
is not discrete, the length
is not matching with the AlphabetContainer
or the ess
is below 0public StructureLearner(AlphabetContainer con, int length) throws IllegalArgumentException
StructureLearner
with equivalent sample
size (ess) = 0.con
- the alphabets this instance should uselength
- the lengthIllegalArgumentException
- if the AlphabetContainer
is not discrete or the
length is not matching with the AlphabetContainer
StructureLearner(AlphabetContainer, int, double)
public AlphabetContainer getAlphabetContainer()
AlphabetContainer
of the
StructureLearner
.AlphabetContainer
of the StructureLearner
public double getEss()
StructureLearner
.StructureLearner
public void setESS(double ess) throws IllegalArgumentException
StructureLearner
.ess
- the ess of the StructureLearner
IllegalArgumentException
- if ess < 0
public int[][] getStructure(DataSet data, double[] weights, StructureLearner.ModelType model, byte order, StructureLearner.LearningType method) throws Exception
data
- the DataSet
weights
- the weightsmodel
- the kind of modelorder
- the Markov ordermethod
- the learning methodException
- if something went wronggetTensor(DataSet, double[], byte, LearningType)
,
getStructure(Tensor, ModelType, byte)
public static int[][] getStructure(Tensor t, StructureLearner.ModelType model, byte order) throws Exception
t
- the tensor containing all relevant weights (includes the
learning method for the structure)model
- the model typeorder
- the model orderException
- if something in the algorithm went wronggetTensor(DataSet, double[], byte, LearningType)
public SymmetricTensor getTensor(DataSet data, double[] weights, byte order, StructureLearner.LearningType method) throws IllegalArgumentException, WrongAlphabetException
Tensor
that can be used to
determine the optimal structure.data
- the dataweights
- the weightsorder
- the Markov ordermethod
- the learning typeIllegalArgumentException
- if something is wrong with the given argumentsWrongAlphabetException
- if the AlphabetContainer
of the data is not correctgetStructure(Tensor, ModelType, byte)