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.

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 which can transition from source state_letter. This returns all letters which the given state_letter can transition to, i.e. all the destination states reachable from state_letter. An empty list is returned if state_letter has no outgoing transitions. 
Get all source states which can transition to destination state_letter. This returns all letters which the given state_letter is reachable from, i.e. all the source states which can reach state_later 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.

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 Mon Jul 10 15:14:28 2017  http://epydoc.sourceforge.net 