With this code:
X = numpy.array(range(0,5)) model = GaussianHMM(n_components=3,covariance_type='full', n_iter=1000) model.fit([X])
I get
tuple index out of range self.n_features = obs[0].shape[1]
So what should you pass .fit () exactly? Hidden states and outliers in a tuple? If so, in what order? The documentation is less useful.
I noticed that he likes to go through tuples, as this does not give an error:
X = numpy.column_stack([range(0,5),range(0,5)]) model = GaussianHMM(n_components=3,covariance_type='full', n_iter=1000) model.fit([X])
Edit:
Let me clarify a bit, the documentation indicates that the routine of the array should be:
List of observation sequences similar to an array (form (n_i, n_features)).
This almost means that you pass a tuple for each sample, which indicates in a binary way which observations are present. However, their example indicates otherwise:
# pack diff and volume for training X = np.column_stack([diff, volume])
therefore confusion
source share