Table of Contents

Class: AbstractTrainer Bio/HMM/Trainer.py

Provide generic functionality needed in all trainers.

Methods   
__init__
estimate_params
log_likelihood
ml_estimator
  __init__ 
__init__ ( self,  markov_model )

  estimate_params 
estimate_params (
        self,
        transition_counts,
        emission_counts,
        )

Get a maximum likelihood estimation of transition and emmission.

Arguments:

  • transition_counts -- A dictionary with the total number of counts of transitions between two states.

  • emissions_counts -- A dictionary with the total number of counts of emmissions of a particular emission letter by a state letter.

This then returns the maximum likelihood estimators for the transitions and emissions, estimated by formulas 3.18 in Durbin et al:

a_{kl} = A_{kl} / sum(A_{kl'}) e_{k}(b) = E_{k}(b) / sum(E_{k}(b'))

Returns: Transition and emission dictionaries containing the maximum likelihood estimators.

  log_likelihood 
log_likelihood ( self,  probabilities )

Calculate the log likelihood of the training seqs.

Arguments:

  • probabilities -- A list of the probabilities of each training sequence under the current paramters, calculated using the forward algorithm.

  ml_estimator 
ml_estimator ( self,  counts )

Calculate the maximum likelihood estimator.

This can calculate maximum likelihoods for both transitions and emissions.

Arguments:

  • counts -- A dictionary of the counts for each item.

See estimate_params for a description of the formula used for calculation.


Table of Contents

This document was automatically generated on Mon Jul 1 12:03:09 2002 by HappyDoc version 2.0.1