Questions tagged [hmmlearn]

hmmlearn is a scikit-learn offspring implementing unsupervised learning and inference in Hidden Markov Models.

hmmlearn is a scikit-learn offspring implementing unsupervised learning and inference in Hidden Markov Models.

130 questions
0
votes
1 answer

how to build a hmm model with strings as the observation sequence?

I have checked lots of examples and found out for python hmmlearn library, the sequence to be put into model.fit() must be a list of numbers, if I have a string list as the input, i need to convert it into a number list first. However, if I have two…
Alicia
  • 75
  • 8
0
votes
1 answer

How to handle multiple sequences in training Hidden Markov Model with hmmlearn?

This question is also on Cross-Validated SE Introduction I'm working with time series data describing power consumption of 5 devices. My goal is to train a best fitting Hidden Markov Model for each device and do classification (i.e. give power…
Brzoskwinia
  • 371
  • 2
  • 11
0
votes
0 answers

Why does my next sequence start from the previous last state using hmmlearn?

I am using Gaussian HMM with hmmlearn library in python. I have multiple sequences and I am modeling a left-right HMM topology: num_states = 15 remodel = hmm.GaussianHMM(n_components=num_states, n_iter=500, …
0
votes
1 answer

How to use standerror() in depmixS4

Summary(fittedmodel) gives me the coefficients of covariance for transition matrics. I am also curious how to get stand error values. it looks like standerror(fittedmodel) can work for that. But I have problem to understand the results. For example,…
Han Rinne
  • 31
  • 4
0
votes
1 answer

Combining several Hidden markov models

I have 3 hidden markov models in python that I trained for each robot behaviours. Imagine I have 3 behaviours A, B and C. And for each of them I have a HMM model. Now I want to combine them together to have one HMM that can recognise a complex…
0
votes
1 answer

Having trouble fitting data to HMM-Learn model (Python3.9)

I am trying to model a Hidden Markov model to some stock data from the S&P500. The data is downloaded from Yahoo Finance and is contained in a CSV-file containing the data for 250 trading days. I had this code working a week ago but now it does not…
Dihre
  • 43
  • 4
0
votes
1 answer

Exogenous variables in hmmlearn's GaussianHMM

I am trying to use hmmlearn's GaussianHMM to fit a Hidden Markov Model with 2 main states, while allowing for multiple exogenous variables. My goal is to determine two states of GDP growth (one with low variance and the other with high variance),…
Bach Pham
  • 59
  • 4
0
votes
1 answer

Hidden Markov Model result(decoding )changes everytime

I use HMM to predict the behavior of humans. Hidden states are Rest walk eat and observations are inside, outside and snack respectively. hState = ['Rset', 'Walk', 'Eat'] Obs = ['Inside 1', 'Outside 2', 'Snack 3'] order = [1, 2, 1, 2, 3 ,2, 2, 3,…
Yash
  • 3
  • 2
0
votes
1 answer

How to update the hmmlearn learned object when we have new samples?

I have implemented a simple code for Hidden Markov Model by hmmlearn and it is working well. I used fit() method, i.e. hmmlearn.fit to learn the hmm parameter based on my data. If I have more data and want to update previously fitted model without…
0
votes
1 answer

Is there a function that computes the probability of a sequence T of observations given a hidden Markov model on hmmlearn?

I have a GaussianHMM that I have fitted using hmmlearn.fit function. I also have a bunch of sequences of observations and I want to compute the probability of each sequence happening given my fitted model. I looked into hmmlearn's documentation and…
0
votes
1 answer

HMMlearn: How to use predict_proba function?

I am trying to use the predict_proba() function on my HMM, but I get an error which i do not fully understand. First of all I create my model as follows: model = hmm.GaussianHMM(n_components=vocab_size, covariance_type="full") model.start_prob_ =…
0
votes
1 answer

Degenerate solution: Why does my model have so many free scalar parameters

I am trying to fit and train a HMM using Hmmlearn, however I get this weird warning that I don't fully understand: Fitting a model with 117917879 free scalar parameters with only 550034 data points will result in a degenerate solution. I use…
0
votes
1 answer

How to fit multiple HMMs in a single dataset using Python?

I am trying to fit HMMs in my dataset for modelling purposes. Using the hmm.GaussianHMM function of hmmlearn, I have fit a single HMM with 2-5 hidden states. My code looks like this: HMMmodel = hmm.GaussianHMM(n_components=2, covariance_type="full",…
sumitpal0593
  • 194
  • 1
  • 3
  • 18
0
votes
1 answer

transition matrix equal to zero using hmmlearn

I am using HMMlearn. I have 4 sets of different observations, that I have concatenated them. I used fit, to learn hmm. first, why transition matrix is equal to zero? Second, why the modell.means_ results in a matrix with the same dimension of the…
bbb
  • 111
  • 3
  • 8
0
votes
0 answers

HMM : Learning states in a signal. (using hmmlearn python library)

I have time series data for which I am trying to learn 3 states in my HMM model. The output which I am getting is this. I want to get three separate states for the 3 distinct clusters of data points. But the first cluster has mixed states learned…
1 2 3
8 9