Can it be used to predict the sequence too?
Aksh97 opened this issue · 11 comments
Using the HMMkay, can it be used to predict the sequence too?
You can predict the most likely sequence of hidden states with the decode
method
Thanks for the quick response. But your code can be modified for predicting the Next Step too right?
The next hidden state or the next observable state?
In both cases, the answer is no though. But for predicting the next observable state you can just take the transition with the highest probability?
Okay..thanks.
And for that, we need to make changes in the decode method itself or write a new function?
This is unrelated to decode
you just have to use the transition
attribute.
Thanks a ton.
Sorry I got confused actually that's not true, the transition
attribute gives you the transitions between hidden states, not observable states.
So using it directly would just give you the most likely next hidden state, without conditioning on the observable state, which is probably not what you want.
If you have a sequence of observable states seq
, then a new observable state os
comes in and you want to know the most likely hidden state for os
, then you can use decode
on seq + [os]
.
You mean to append the 'os' with the 'seq' and then pass in the decode function?
yes
Thanks and Also if 'seq' contains 5 column list with 200 rows and 'os' added is 3 column list. It gives a hidden state for that 3 columns in the 201st row.
What I am asking can it predict hidden state for all 5 columns, when 3 elements are appends through 'os'.
In easy words, I want to Determine the two likely next states according to the largest two probabilities