Re: [Scikit-learn-general] Hidden Markov Model for one dimensional time series data

2013-10-21 Thread Alexandr M
No, it works, thanks! I used model.fit(signal) instead of model.fit( [signal] ) model = GaussianHMM(n_components = 2) s1 = np.random.randn(50,1) s2 = np.random.randn(50,1)+5 signal = np.concatenate([s1, s2]) model.fit([signal]) BR, Alexandr On 21 October 2013 01:42, Robert McGibbon wrote: >

Re: [Scikit-learn-general] Hidden Markov Model for one dimensional time series data

2013-10-21 Thread Alexandr M
Hi Robert, No, it doesn't work: model = GaussianHMM(n_components = 2) s1 = np.random.randn(50,1) s2 = np.random.randn(50,1)+5 signal = np.concatenate([s1, s2]) model.fit(signal) .../lib/python2.7/site-packages/sklearn/hmm.pyc in _init(self, obs, params)754 self.n_features))755 --> 756

Re: [Scikit-learn-general] Hidden Markov Model for one dimensional time series data

2013-10-20 Thread Robert McGibbon
Yeah, just reshape s1 and s2 to be (50,1). > s1 = np.random.randn(50,1) > s2 = np.random.randn(50,1)+5 -Robert On Oct 18, 2013, at 3:57 PM, Alexandr M wrote: > Hello everybody, > > I am trying to fit HMM model with two components > GaussianHMM(n_components = 2) > to one dimensional vector: >

[Scikit-learn-general] Hidden Markov Model for one dimensional time series data

2013-10-18 Thread Alexandr M
Hello everybody, I am trying to fit HMM model with two components *GaussianHMM(n_components = 2)* to one dimensional vector: # Code: from sklearn.hmm import GaussianHMM import numpy as np import matplotlib.pyplot as plt model = GaussianHMM(n_components = 2) s1 = np.random.randn(50) s2 = np.ran