Skip to content

Commit

Permalink
bw algorithm example corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
maximtrp committed Sep 12, 2020
1 parent b947597 commit a068bf1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 4 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -235,17 +235,19 @@ Using Baum-Welch algorithm to infer the parameters of a Hidden Markov model:
'pi': [0.009030829793043593, 0.016658391248503462, 0.0038894983546756065]
}

Inferred transition (`tp`), emission (`ep`) probability matrices and
The inferred transition (`tp`), emission (`ep`) probability matrices and
initial state distribution (`pi`) can be accessed as shown:

.. code:: python
>>> a.ep, a.tp, a.pi
This model can be decoded using Viterbi algorithm:

.. code:: python
>>> new_obs = "GGCATTGGGCTATAAGAGGAGCTTG"
>>> vs, vsi = m.viterbi(new_obs)
>>> vs, vsi = a.viterbi(new_obs)
>>> print("VI", "".join(vs))
>>> print("NO", new_obs)
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
# This flag says that the code is written to work on both Python 2 and Python
# 3. If at all possible, it is good practice to do this. If you cannot, you
# will need to generate wheels for each Python version that you support.
universal=1
[metadata]
description-file = README.rst

0 comments on commit a068bf1

Please sign in to comment.