mattjj / pyhsmm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Computing sequence likelihood

AnuragDataGeek opened this issue · comments

I am working on device failure detection using logs and trying to use HSMM for the same (https://github.com/mattjj/pyhsmm ). I have trained HSMM models one with failure sequences and another with non-failure sequences. Now with the saved models I am trying to test a new set of observations to get the sequence liklihood for it being a a failure or normal sequence.

For the above I am using predict():pyhsmm/models.py. The output of predict is a shown below. I wanted to know how to compute the sequence liklihood of the test observations ? Can you please help me interpret the values below .
[ 1.09126953, 0.22327257, 0.20143636, 0.04108898, 0.03599046,... and array([1, 1, 1, 1] ?

(array([[...... Test data as part of the test observations .......], [ 1.09126953, 0.22327257, 0.20143636, 0.04108898, 0.03599046, -0.0550454 , -0.07768027, 0.12503039, -0.06587717, -0.01986415, 0.06915982, 0.04355503, 0.00769478, 0.16021187, -0.0279765 , -0.0373802 , 0.18039266, -0.09677505, -0.15166285, 0.2287205 , -0.03028628, 0.10230527, -0.06530587, 0.72394045, 0.03041114, 0.16389177, -0.04364231, 0.15056836, -0.03810938, -0.03452764, -0.12516243, 0.01363949, 0.35267065, -0.09778672, 0.0882772 , 0.03994774, -0.00908577, 0.06151574, 0.0368631 , -0.01967793, -0.09689663, 0.01046816, -0.0914735 , 0.01364949, 5.19169793]]), array([1, 1, 1, 1], dtype=int32))

Use model.log_likelihood(sequence) to get the log-likelihood of a sequence, given the learned parameters.