Package Bio :: Package HMM :: Module Trainer :: Class KnownStateTrainer
[show private | hide private]
[frames | no frames]

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)
  train(self, training_seqs)
Estimate the Markov Model parameters with known state paths.
  _count_emissions(self, training_seq, emission_counts)
Add emissions from the training sequence to the current counts.
  _count_transitions(self, state_seq, transition_counts)
Add transitions from the training sequence to the current counts.
    Inherited from AbstractTrainer
  estimate_params(self, transition_counts, emission_counts)
Get a maximum likelihood estimation of transition and emmission.
  log_likelihood(self, probabilities)
Calculate the log likelihood of the training seqs.
  ml_estimator(self, counts)
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.

Generated by Epydoc 2.1 on Wed Jan 31 09:59:42 2007 http://epydoc.sf.net