From a068bf1757542bf5afb22e017536cc32c75f4eab Mon Sep 17 00:00:00 2001 From: Maksim Terpilowski Date: Sat, 12 Sep 2020 21:23:13 +0300 Subject: [PATCH] bw algorithm example corrected --- README.rst | 6 ++++-- setup.cfg | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index b384d45..1cb3146 100644 --- a/README.rst +++ b/README.rst @@ -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) diff --git a/setup.cfg b/setup.cfg index aaf1c25..e9c7980 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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