HiddenMarkovModel
- class pyopenms.HiddenMarkovModel
Bases:
objectCython implementation of _HiddenMarkovModel
Original C++ documentation is available here
- __init__()
Overload:
- __init__(self) → None
Hidden Markov Model implementation of PILIS
Overload:
- __init__(self, in_0: HiddenMarkovModel) → None
Methods
Overload:
Overload:
addSynonymTransition(self, name1, name2, ...)Add a new synonym transition to the given state names
clear(self)Clears all data
Clears the initial probabilities
Clear the emission probabilities
disableTransition(self, s1, s2)Disables the transition; deletes the nodes from the predecessor/successor list respectively
disableTransitions(self)Disables all transitions
dump(self)Writes some stats to cerr
enableTransition(self, s1, s2)Enables a transition; adds s1 to the predecessor list of s2 and s2 to the successor list of s1
Estimates the transition probabilities of not trained transitions by averages similar trained ones
evaluate(self)Evaluate the HMM, estimates the transition probabilities from the training
forwardDump(self)Writes some info of the forward "matrix" to cerr
getNumberOfStates(self)Returns the number of states
getPseudoCounts(self)Returns the pseudo counts
getState(self, name)Returns the state with the given name
getTransitionProbability(self, s1, s2)Returns the transition probability of the given state names
setInitialTransitionProbability(self, state, ...)Sets the initial transition probability of the given state to prob
setPseudoCounts(self, pseudo_counts)Sets the pseudo count that are added instead of zero
setTrainingEmissionProbability(self, state, prob)Sets the emission probability of the given state to prob
setTransitionProbability(self, s1, s2, prob)Sets the transition probability of the given state names to prob
setVariableModifications(self, modifications)train(self)Trains the HMM.
writeGraphMLFile(self, filename)Writes the HMM into a file in GraphML format
- addNewState()
Overload:
- addNewState(self, state: HMMState) → None
Registers a new state to the HMM
Overload:
- addNewState(self, name: Union[bytes, str, String]) → None
Registers a new state to the HMM
- addSynonymTransition(self, name1: Union[bytes, str, String], name2: Union[bytes, str, String], synonym1: Union[bytes, str, String], synonym2: Union[bytes, str, String]) → None
Add a new synonym transition to the given state names
- clear(self) → None
Clears all data
- clearInitialTransitionProbabilities(self) → None
Clears the initial probabilities
- clearTrainingEmissionProbabilities(self) → None
Clear the emission probabilities
- disableTransition(self, s1: Union[bytes, str, String], s2: Union[bytes, str, String]) → None
Disables the transition; deletes the nodes from the predecessor/successor list respectively
- disableTransitions(self) → None
Disables all transitions
- dump(self) → None
Writes some stats to cerr
- enableTransition(self, s1: Union[bytes, str, String], s2: Union[bytes, str, String]) → None
Enables a transition; adds s1 to the predecessor list of s2 and s2 to the successor list of s1
- estimateUntrainedTransitions(self) → None
Estimates the transition probabilities of not trained transitions by averages similar trained ones
- evaluate(self) → None
Evaluate the HMM, estimates the transition probabilities from the training
- forwardDump(self) → None
Writes some info of the forward “matrix” to cerr
- getNumberOfStates(self) → int
Returns the number of states
- getPseudoCounts(self) → float
Returns the pseudo counts
- getTransitionProbability(self, s1: Union[bytes, str, String], s2: Union[bytes, str, String]) → float
Returns the transition probability of the given state names
- setInitialTransitionProbability(self, state: Union[bytes, str, String], prob: float) → None
Sets the initial transition probability of the given state to prob
- setPseudoCounts(self, pseudo_counts: float) → None
Sets the pseudo count that are added instead of zero
- setTrainingEmissionProbability(self, state: Union[bytes, str, String], prob: float) → None
Sets the emission probability of the given state to prob
- setTransitionProbability(self, s1: Union[bytes, str, String], s2: Union[bytes, str, String], prob: float) → None
Sets the transition probability of the given state names to prob
- setVariableModifications(self, modifications: List[bytes]) → None
- train(self) → None
Trains the HMM. Initial probabilities and emission probabilities of the emitting states should be set