Skip to content

Commit

Permalink
Fix typos in HiddenMarkovModel doc string example (jmschrei#506)
Browse files Browse the repository at this point in the history
* Fix example in doc string for `HiddenMarkovModel`

* Python 3 compatible print statements in `HiddenMarkovModel` doc string
  • Loading branch information
paulbrodersen authored and jmschrei committed Oct 24, 2018
1 parent 00712a3 commit 9f92cc6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pomegranate/hmm.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ cdef class HiddenMarkovModel(GraphModel):
Examples
--------
>>> from pomegranate import *
>>> d1 = DiscreteDistribution({'A' : 0.35, 'C' : 0.20, 'G' : 0.05, 'T' : 40})
>>> d2 = DiscreteDistribution({'A' : 0.25, 'C' : 0.25, 'G' : 0.25, 'T' : 25})
>>> d3 = DiscreteDistribution({'A' : 0.10, 'C' : 0.40, 'G' : 0.40, 'T' : 10})
>>> d1 = DiscreteDistribution({'A' : 0.35, 'C' : 0.20, 'G' : 0.05, 'T' : 0.40})
>>> d2 = DiscreteDistribution({'A' : 0.25, 'C' : 0.25, 'G' : 0.25, 'T' : 0.25})
>>> d3 = DiscreteDistribution({'A' : 0.10, 'C' : 0.40, 'G' : 0.40, 'T' : 0.10})
>>>
>>> s1 = State(d1, name="s1")
>>> s2 = State(d2, name="s2")
Expand All @@ -177,9 +177,9 @@ cdef class HiddenMarkovModel(GraphModel):
>>> model.add_transition(s3, model.end, 0.30)
>>> model.bake()
>>>
>>> print model.log_probability(list('ACGACTATTCGAT'))
-4.31828085576
>>> print ", ".join(state.name for i, state in model.viterbi(list('ACGACTATTCGAT'))[1])
>>> print(model.log_probability(list('ACGACTATTCGAT')))
-22.73896159971087
>>> print(", ".join(state.name for i, state in model.viterbi(list('ACGACTATTCGAT'))[1]))
example-start, s1, s2, s2, s2, s2, s2, s2, s2, s2, s2, s2, s2, s3, example-end
"""

Expand Down

0 comments on commit 9f92cc6

Please sign in to comment.