public class FSDAGTrainSM extends DAGTrainSM
FSDAGTrainSM).constraintsDEFAULT_STREAM, sostreamparams, trainedalphabets, length| Constructor and Description |
|---|
FSDAGTrainSM(FSDAGTrainSMParameterSet params)
This is the main constructor.
|
FSDAGTrainSM(StringBuffer xml)
The standard constructor for the interface
Storable. |
| Modifier and Type | Method and Description |
|---|---|
void |
drawParameters(DataSet data,
double[] weights,
int[][] graph)
This method draws the parameters of the model from the a posteriori
density.
|
String |
getInstanceName()
Should return a short instance name such as iMM(0), BN(2), ...
|
byte |
getMaximalMarkovOrder()
This method returns the maximal used Markov order, if possible.
|
String |
getStructure()
Returns a
String representation of the underlying graph. |
protected String |
getXMLTag()
Returns the XML tag that is used for this model in
DiscreteGraphicalTrainSM.fromXML(StringBuffer) and DiscreteGraphicalTrainSM.toXML(). |
protected void |
set(DGTrainSMParameterSet params,
boolean trained)
Sets the parameters as internal parameters and does some essential
computations.
|
void |
train(DataSet data,
double[] weights)
Trains the
TrainableStatisticalModel object given the data as DataSet using
the specified weights. |
void |
train(DataSet data,
double[] weights,
int[][] graph)
Computes the model with structure
graph. |
static void |
train(TrainableStatisticalModel[] models,
int[][] graph,
double[][] weights,
DataSet... data)
Computes the models with structure
graph. |
checkAcyclic, clone, createConstraints, drawParameters, emitDataSet, estimateParameters, getFurtherModelInfos, getLogPriorTerm, getLogProbFor, getNumericalCharacteristics, setFurtherModelInfos, toStringcheck, setOutputStreamfromXML, getCurrentParameterSet, getDescription, getESS, isInitialized, toXMLgetAlphabetContainer, getCharacteristics, getLength, getLogProbFor, getLogProbFor, getLogScoreFor, getLogScoreFor, getLogScoreFor, getLogScoreFor, getLogScoreFor, toString, trainpublic FSDAGTrainSM(FSDAGTrainSMParameterSet params) throws CloneNotSupportedException, IllegalArgumentException, NonParsableException
FSDAGTrainSM from
the given FSDAGTrainSMParameterSet.params - the given parameter setCloneNotSupportedException - if the parameter set could not be clonedIllegalArgumentException - if the parameter set is not instantiatedNonParsableException - if the parameter set is not parsableDAGTrainSM.DAGTrainSM(de.jstacs.sequenceScores.statisticalModels.trainable.discrete.inhomogeneous.parameters.IDGTrainSMParameterSet)public FSDAGTrainSM(StringBuffer xml) throws NonParsableException
Storable.
Creates a new FSDAGTrainSM out of its XML representation.xml - the XML representation as StringBufferNonParsableException - if the FSDAGTrainSM could not be reconstructed out of
the XML representation (the StringBuffer could not be
parsed)Storable,
DAGTrainSM.DAGTrainSM(StringBuffer)public String getInstanceName()
SequenceScorepublic byte getMaximalMarkovOrder()
StatisticalModelgetMaximalMarkovOrder in interface StatisticalModelgetMaximalMarkovOrder in class AbstractTrainableStatisticalModelprotected String getXMLTag()
DiscreteGraphicalTrainSMDiscreteGraphicalTrainSM.fromXML(StringBuffer) and DiscreteGraphicalTrainSM.toXML().getXMLTag in class DiscreteGraphicalTrainSMDiscreteGraphicalTrainSM.fromXML(StringBuffer) and
DiscreteGraphicalTrainSM.toXML()DiscreteGraphicalTrainSM.fromXML(StringBuffer),
DiscreteGraphicalTrainSM.toXML()public void train(DataSet data, double[] weights) throws Exception
TrainableStatisticalModelTrainableStatisticalModel object given the data as DataSet using
the specified weights. The weight at position i belongs to the element at
position i. So the array weight should have the number of
sequences in the data set as dimension. (Optionally it is possible to use
weight == null if all weights have the value one.)train(data1); train(data2)
should be a fully trained model over data2 and not over
data1+data2. All parameters of the model were given by the
call of the constructor.data - the given sequences as DataSetweights - the weights of the elements, each weight should be
non-negativeException - if the training did not succeed (e.g. the dimension of
weights and the number of sequences in the
data set do not match)DataSet.getElementAt(int),
DataSet.ElementEnumeratorpublic void train(DataSet data, double[] weights, int[][] graph) throws Exception
graph.public void drawParameters(DataSet data, double[] weights, int[][] graph) throws Exception
null. Furthermore this method enables you to
specify a new graph structure.data - a DataSet or nullweights - the (positive) weights for each sequence of the DataSet
or nullgraph - the graph or null for the current graphException - if something went wrongDAGTrainSM.drawParameters(DataSet, double[]),
DAGTrainSM.checkAcyclic(int, int[][])public static void train(TrainableStatisticalModel[] models, int[][] graph, double[][] weights, DataSet... data) throws Exception
graph.models - an array of AbstractTrainableStatisticalModels containing
only instances of FSDAGTrainSMdata - the DataSetweights - the weights for the sequences in the DataSetgraph - the graphException - if something went wrongprotected void set(DGTrainSMParameterSet params, boolean trained) throws CloneNotSupportedException, NonParsableException
DiscreteGraphicalTrainSMfromParameterSet-methods.set in class InhomogeneousDGTrainSMparams - the new ParameterSettrained - indicates if the model is trained or notCloneNotSupportedException - if the parameter set could not be clonedNonParsableException - if the parameters of the model could not be parsedpublic String getStructure()
InhomogeneousDGTrainSMString representation of the underlying graph.getStructure in class DAGTrainSMString representation of the underlying graph