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

Class KnownStateTrainer

source code

     object --+    
              |    
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.

Instance Methods [hide private]
 
__init__(self, markov_model)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
train(self, training_seqs)
Estimate the Markov Model parameters with known state paths.
source code
 
_count_emissions(self, training_seq, emission_counts)
Add emissions from the training sequence to the current counts.
source code
 
_count_transitions(self, state_seq, transition_counts)
Add transitions from the training sequence to the current counts.
source code

Inherited from AbstractTrainer: estimate_params, log_likelihood, ml_estimator

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, markov_model)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

train(self, training_seqs)

source code 

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)

source code 

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)

source code 

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.