thanks for your help, I am new about this topic.
I have a dataset composed of a sequence of binary observable variables associated with a label, like this.
trainset = [ [0,0,1,0],[0,0,1,0],[0,0,0,1],...,]
labels = [ 0,1,2,...,]
states = 3 # number of unique labels
I am trying to train an HMM in this way
model = HiddenMarkovModel.from_samples(distribution = MultivariateGaussianDistribution, n_components = states,
X= [trainset],
labels = [labels],
algorithm = 'labeled')
When I ran this model, I get this Exception
Exception ignored in: 'pomegranate.hmm.HiddenMarkovModel._labeled_summarize' KeyError:
3
I figure out that the exception is raised when there are no observations for the state -3
-.
But , state 3
is in my labels.
Can someone help me, please?
thanks