public class FSMEManager extends MEManager
factors
DEFAULT_STREAM, sostream
params, trained
alphabets, length
Constructor and Description |
---|
FSMEManager(FSMEMParameterSet params)
Creates a new
MEManager from a given
MEManagerParameterSet . |
FSMEManager(StringBuffer stringBuff)
The standard constructor for the interface
Storable . |
Modifier and Type | Method and Description |
---|---|
String |
getInstanceName()
Should return a short instance name such as iMM(0), BN(2), ...
|
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. |
clone, emitDataSet, getFactors, getFactors, getFurtherModelInfos, getLogPriorTerm, getLogProbFor, getNumericalCharacteristics, getStructure, setFurtherModelInfos, toString, trainFactors
check, setOutputStream
fromXML, getCurrentParameterSet, getDescription, getESS, isInitialized, toXML
getAlphabetContainer, getCharacteristics, getLength, getLogProbFor, getLogProbFor, getLogScoreFor, getLogScoreFor, getLogScoreFor, getLogScoreFor, getLogScoreFor, getMaximalMarkovOrder, toString, train
public FSMEManager(FSMEMParameterSet params) throws CloneNotSupportedException, IllegalArgumentException, NonParsableException
MEManager
from a given
MEManagerParameterSet
.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 parsableMEManager.MEManager(MEManagerParameterSet)
public FSMEManager(StringBuffer stringBuff) throws NonParsableException
Storable
.
Creates a new FSMEManager
out of its XML representation.stringBuff
- the XML representation as StringBuffer
NonParsableException
- if the FSMEManager
could not be reconstructed
out of the XML representation (the StringBuffer
could
not be parsed)Storable
,
MEManager.MEManager(StringBuffer)
public String getInstanceName()
SequenceScore
public void train(DataSet data, double[] weights) throws Exception
TrainableStatisticalModel
TrainableStatisticalModel
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 DataSet
weights
- 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.ElementEnumerator
protected String getXMLTag()
DiscreteGraphicalTrainSM
DiscreteGraphicalTrainSM.fromXML(StringBuffer)
and DiscreteGraphicalTrainSM.toXML()
.getXMLTag
in class DiscreteGraphicalTrainSM
DiscreteGraphicalTrainSM.fromXML(StringBuffer)
and
DiscreteGraphicalTrainSM.toXML()
DiscreteGraphicalTrainSM.fromXML(StringBuffer)
,
DiscreteGraphicalTrainSM.toXML()
protected void set(DGTrainSMParameterSet params, boolean trained) throws CloneNotSupportedException, NonParsableException
DiscreteGraphicalTrainSM
fromParameterSet
-methods.set
in class InhomogeneousDGTrainSM
params
- the new ParameterSet
trained
- 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 parsed