Trees  Indices  Help 



object +  HiddenMarkovModel
















Inherited from 


Inherited from 

Initialize a Markov Model. Note: You should use the MarkovModelBuilder class instead of initiating this class directly. Arguments: o initial_prob  A dictionary of initial probabilities for all states. o transition_prob  A dictionary of transition probabilities for all possible transitions in the sequence. o emission_prob  A dictionary of emission probabilities for all possible emissions from the sequence states. o transition_pseudo  Pseudocounts to be used for the transitions, when counting for purposes of estimating transition probabilities. o emission_pseudo  Pseudocounts to be used for the emissions, when counting for purposes of estimating emission probabilities.

Get the default transitions for the model. Returns a dictionary of all of the default transitions between any two letters in the sequence alphabet. The dictionary is structured with keys as (letter1, letter2) and values as the starting number of transitions. 
Get the starting default emmissions for each sequence. This returns a dictionary of the default emmissions for each letter. The dictionary is structured with keys as (seq_letter, emmission_letter) and values as the starting number of emmissions. 
Get all destination states to which there are transitions from the state_letter source state. This returns all letters which the given state_letter can transition to. An empty list is returned if state_letter has no outgoing transitions. 
Get all source states from which there are transitions to the state_letter destination state. This returns all letters which the given state_letter is reachable from. An empty list is returned if state_letter is unreachable. 
Calculate the most probable state path using the Viterbi algorithm. This implements the Viterbi algorithm (see pgs 5557 in Durbin et al for a full explanation  this is where I took my implementation ideas from), to allow decoding of the state path, given a sequence of emissions. Arguments: o sequence  A Seq object with the emission sequence that we want to decode. o state_alphabet  The alphabet of the possible state sequences that can be generated. 
Return log transform of the given probability dictionary. When calculating the Viterbi equation, add logs of probabilities rather than multiplying probabilities, to avoid underflow errors. This method returns a new dictionary with the same keys as the given dictionary and logtransformed values. 
Trees  Indices  Help 


Generated by Epydoc 3.0.1 on Wed Jun 8 15:02:52 2016  http://epydoc.sourceforge.net 