Content deleted Content added
S M Woodall (talk | contribs) →Example: Altered wording to make it gender-neutral, removing the unnecessary assumption that doctor and patient were male. Also made the explanation (I hope) slightly clearer. |
|||
Line 106:
== Example ==
Consider a village where all villagers are either healthy or have a fever, and only the village doctor can determine whether each has a fever. The doctor diagnoses fever by asking patients how they feel. The villagers may only answer that they feel normal, dizzy, or cold.
The doctor believes that the health condition of
The ''observations'' (normal, cold, dizzy) along with a ''hidden'' state (healthy, fever) form a hidden Markov model (HMM), and can be represented as follows in the [[Python (programming language)|Python programming language]]:
Line 124:
}
</syntaxhighlight>
In this piece of code, <code>start_p</code> represents the doctor's belief about which state the HMM is in when the patient first visits (all
[[File:An example of HMM.png|thumb|center|300px|Graphical representation of the given HMM]]
<syntaxhighlight lang="python" line="1">
Line 200:
</syntaxhighlight>
This reveals that the observations <code>['normal', 'cold', 'dizzy']</code> were most likely generated by states <code>['Healthy', 'Healthy', 'Fever']</code>. In other words, given the observed activities, the patient was most likely to have been healthy
The operation of Viterbi's algorithm can be visualized by means of a
|