[SOLVED] 程序代写 # Problem 1 – Part (b)

30 $

File Name: 程序代写_#_Problem_1_–_Part_(b).zip
File Size: 348.54 KB

SKU: 5870902624 Category: Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Or Upload Your Assignment Here:


# Problem 1 – Part (b)

import sys
import numpy as np

Copyright By PowCoder代写加微信 assignmentchef

# find_most_likely_seq(init_prob, evid_seq, T, E)
# 1. Find the most likely sequence of states.
# Parameters:
# 1. init_prob: Initial probabilities
# 2. evid_seq: Evidence seqeuence
# 3. T: T matrix
# 4. E: E matrix
def find_most_likely_seq(init_prob, evid_seq, T, E):

# 1. Read users’ input.
# 2. Find the most likely sequence of states.
def main():
n = int(sys.argv[1])
evid_seq = []
for i in range(n):
evid_seq.append(int(sys.argv[i+2]))

T = np.matrix([[0.7, 0.3], [0.4, 0.6]])
E = np.matrix([[0.9, 0.1], [0.3, 0.7]])
init_prob = np.array([0.5, 0.5])
max_seq = find_most_likely_seq(init_prob, evid_seq, T, E)
n = len(max_seq)
for i in range(n):
print(max_seq[i], end=” “)

if __name__ == “__main__”:

程序代写 CS代考加微信: assignmentchef QQ: 1823890830 Email: [email protected]

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] 程序代写 # Problem 1 – Part (b)
30 $