Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scikit Learn HMM training with set of observation sequences

I had a question about how I can use gaussianHMM in the scikit-learn package to train on several different observation sequences all at once. The example is here: visualizing the stock market structure

shows EM converging on 1 long observation sequence. But in many scenarios, we want to break up the observations (like training on set of sentences) with each observation sequence having a START and END state. That is, I would like to globally train on multiple observation sequences. How can one accomplish this when using GuassianHMM? Is there a example to look at?

Thanks in advance

like image 435
A.D Avatar asked Dec 07 '13 19:12

A.D


1 Answers

In attached example you do

model.fit([X])

which is training on a singleton of observations, if you have multiple ones, for example X1,X2,X3 you can run

model.fit([X1,X2,X3])

in general for HMM implementation in scikit-learn you give it a sequence of observations S

model.fit(S)
like image 67
lejlot Avatar answered Oct 17 '22 03:10

lejlot