Sale!

CECS 451 Assignment 10 solved

Original price was: $35.00.Current price is: $30.00. $25.50

Category:

Description

5/5 - (2 votes)

1. (40 points) Implement a Python program to perform filtering in the hidden Markov
model (HMM).
(a) Assume that hidden state variable and evidence variable are binary variables.
(b) The program should compute P~ (Xt
|~e1:t) when ~e1:t
is given.
(c) The input to the program is a text file which includes multiple lines.
(d) Each line contains independent variables a, b, c, d, f, e1, e2, · · · , et
in Figure 1 in that
order. For example,
0.5,0.7,0.3,0.9,0.2,t,t
means a = 0.5, b = 0.7, c = 0.3, d = 0.9, f = 0.2, e1 = t, e2 = t.
Figure 1: HMM of binary variables.
(e) The program outputs the probability P~ (Xt
|~e1:t). For example,
0.5,0.7,0.3,0.9,0.2,t,t–><0.8834,0.1166>
0.5,0.7,0.3,0.9,0.2,t,t,f–><0.1907,0.8093>
Do not include white spaces in a line and fix the precision using “{:.4f}”.format()
CECS 451 Assignment 10 – Page 2 of 2
(f) The program should be able to executed on Python 3 interpreter. I will test your
program with this command:
> python hmm.py cpt.txt
Please note that the names of the program and the input file would be modified,
therefore, your program should use sys.argv instead of “hard coding”.
(g) About grading
• The output format should be same as the output example.
• No credit will be given if the program is not executable.
• The actual input file includes more lines.