Trees | Index | Help |
---|
Package Bio :: Package HMM :: Module Trainer :: Class KnownStateTrainer |
|
AbstractTrainer
--+
|
KnownStateTrainer
Estimate probabilities with known state sequences.
This should be used for direct estimation of emission and transition probabilities when both the state path and emission sequence are known for the training examples.Method Summary | |
---|---|
__init__(self,
markov_model)
| |
Estimate the Markov Model parameters with known state paths. | |
Add emissions from the training sequence to the current counts. | |
Add transitions from the training sequence to the current counts. | |
Inherited from AbstractTrainer | |
Get a maximum likelihood estimation of transition and emmission. | |
Calculate the log likelihood of the training seqs. | |
Calculate the maximum likelihood estimator. |
Method Details |
---|
train(self, training_seqs)Estimate the Markov Model parameters with known state paths. This trainer requires that both the state and the emissions are known for all of the training sequences in the list of TrainingSequence objects. This training will then count all of the transitions and emissions, and use this to estimate the parameters of the model. |
_count_emissions(self, training_seq, emission_counts)Add emissions from the training sequence to the current counts. Arguments: o training_seq -- A TrainingSequence with states and emissions to get the counts from o emission_counts -- The current emission counts to add to. |
_count_transitions(self, state_seq, transition_counts)Add transitions from the training sequence to the current counts. Arguments: o state_seq -- A Seq object with the states of the current training sequence. o transition_counts -- The current transition counts to add to. |
Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Sat Jul 16 15:49:02 2005 | http://epydoc.sf.net |