我已经使用以下方法实现了 HMM hmmlearn
:
states = ['healthy','sick']
observations = ['sleeping','eating','pooping']
model = HMM(n_components=2)
model.n_features = 3
model.startprob_ = [0.7, 0.3]
model.transmat_ = [
[0.8, 0.2],
[0.4, 0.6]
]
model.emissionprob_ = [
[0.2, 0.6, 0.2],
[0.4, 0.1, 0.5],
]
我也有一系列观察结果:
obs = np.array([0,0,1,0,2,0,1,2,0,1,0,2,0,1,1,2,0])
obs = obs.reshape(-1, 1)
现在我想预测下一次观察(在 t+1 时),但不知道如何。
(*我已阅读文档但一无所获)