i have implemented a HMM using 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],
]
and i have a sequence of observations too:
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)
now i want to predict the next observation(at t+1), but don't know how.
(*i've read the docs but found nothing)
i found out that there is no function to do this just can use model.predict()
to get hidden states probabilities and then find out the next state(and observation).