First of all my hmmlearn version is 0.3.0b (installed using conda).
I am trying to implement a GMMHMM model in hmmlearn but I am getting:
ValueError: n_samples=3 should be >= n_clusters=5
To become more specific I have a model of 4 states and 5 mixture Gaussians (clusters) and my input X variable has shape(20,3)
as mentioned in the documentation i.e. (n_samples, n_features)
.
Here is the code so that create the error:
import numpy as np
from hmmlearn import hmm
size = 30
data = np.concatenate((np.random.normal(0,1,size), np.random.normal(5,2,size)))
np.random.shuffle(data)
x = np.reshape(data,(-1,3))
model = hmm.GMMHMM(n_components=4, n_mix=5)
model.fit(x)
Could anyone find any reasoning for that or is it a bug of the library? I couldn't find online examples of implementing the GMMHMM model.