public abstract class InhomogeneousDGTrainSM extends DiscreteGraphicalTrainSM
InhomogeneousDGTrainSM
).IDGTrainSMParameterSet
Modifier and Type | Field and Description |
---|---|
protected static OutputStream |
DEFAULT_STREAM
The default
OutputStream . |
protected SafeOutputStream |
sostream
This stream is used for comments, computation steps/results or any other
kind of output during the training, ...
|
params, trained
alphabets, length
Constructor and Description |
---|
InhomogeneousDGTrainSM(IDGTrainSMParameterSet params)
Creates a new
InhomogeneousDGTrainSM from a given
IDGTrainSMParameterSet . |
InhomogeneousDGTrainSM(StringBuffer representation)
The standard constructor for the interface
Storable . |
Modifier and Type | Method and Description |
---|---|
protected void |
check(Sequence sequence,
int startpos,
int endpos)
Checks some conditions on a
Sequence . |
InhomogeneousDGTrainSM |
clone()
Follows the conventions of
Object 's clone() -method. |
abstract String |
getStructure()
Returns a
String representation of the underlying graph. |
protected void |
set(DGTrainSMParameterSet parameter,
boolean trained)
Sets the parameters as internal parameters and does some essential
computations.
|
void |
setOutputStream(OutputStream stream)
Sets the
OutputStream for the model. |
fromXML, getCurrentParameterSet, getDescription, getESS, getFurtherModelInfos, getXMLTag, isInitialized, setFurtherModelInfos, toString, toXML
emitDataSet, getAlphabetContainer, getCharacteristics, getLength, getLogProbFor, getLogProbFor, getLogScoreFor, getLogScoreFor, getLogScoreFor, getLogScoreFor, getLogScoreFor, getMaximalMarkovOrder, toString, train
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
train
getLogPriorTerm, getLogProbFor
getInstanceName, getNumericalCharacteristics
protected SafeOutputStream sostream
protected static final OutputStream DEFAULT_STREAM
OutputStream
.public InhomogeneousDGTrainSM(IDGTrainSMParameterSet params) throws CloneNotSupportedException, IllegalArgumentException, NonParsableException
InhomogeneousDGTrainSM
from a given
IDGTrainSMParameterSet
.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 parsableDiscreteGraphicalTrainSM.DiscreteGraphicalTrainSM(DGTrainSMParameterSet)
public InhomogeneousDGTrainSM(StringBuffer representation) throws NonParsableException
Storable
.
Creates a new InhomogeneousDGTrainSM
out of its XML representation.representation
- the XML representation as StringBuffer
NonParsableException
- if the InhomogeneousDGTrainSM
could not be reconstructed
out of the XML representation (the StringBuffer
could
not be parsed)Storable
,
DiscreteGraphicalTrainSM.DiscreteGraphicalTrainSM(StringBuffer)
public InhomogeneousDGTrainSM clone() throws CloneNotSupportedException
AbstractTrainableStatisticalModel
Object
's clone()
-method.clone
in interface SequenceScore
clone
in interface TrainableStatisticalModel
clone
in class DiscreteGraphicalTrainSM
AbstractTrainableStatisticalModel
(the member-AlphabetContainer
isn't deeply cloned since
it is assumed to be immutable). The type of the returned object
is defined by the class X
directly inherited from
AbstractTrainableStatisticalModel
. Hence X
's
clone()
-method should work as:Object o = (X)super.clone();
o
defined by
X
that are not of simple data-types like
int
, double
, ... have to be deeply
copied return o
CloneNotSupportedException
- if something went wrong while cloningpublic abstract String getStructure() throws NotTrainedException
String
representation of the underlying graph.String
representation of the underlying graphNotTrainedException
- if the structure is not set, this can only be the case if the
model is not trainedpublic void setOutputStream(OutputStream stream)
OutputStream
for the model. This stream will sometimes
be used to write some information about the
training/progress/computation... etc. to the screen, a file ... etc.stream
- the OutputStream
SafeOutputStream
protected void check(Sequence sequence, int startpos, int endpos) throws NotTrainedException, IllegalArgumentException
DiscreteGraphicalTrainSM
Sequence
. These are in general
conditions on the AlphabetContainer
of a (sub)
Sequence
between startpos
und endpos
.check
in class DiscreteGraphicalTrainSM
sequence
- the Sequence
startpos
- the startpositionendpos
- the endpositionNotTrainedException
- if the model is not trainedIllegalArgumentException
- if some constraints are not fulfilledprotected void set(DGTrainSMParameterSet parameter, boolean trained) throws CloneNotSupportedException, NonParsableException
DiscreteGraphicalTrainSM
fromParameterSet
-methods.set
in class DiscreteGraphicalTrainSM
parameter
- 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