Questions tagged [hidden-markov-models]

Hidden Markov Models are a model for understanding and predicting sequential data in statistics and machine learning, commonly used in natural language processing and bioinformatics.

Hidden Markov Models (HMM) are a model for understanding and predicting sequential data in statistics and machine learning, commonly used in natural language processing and bioinformatics. In HMM, the hidden state variable cannot be observed, but usually some output variable that dependent on the hidden state is visible.

520 questions
6
votes
1 answer

Hidden Markov Model for three-sided dice

I was taught HMM and given this homework problem. I understood a part of it, but I'm not sure if its correct. The problem is: Consider a different game where the dealer is not flipping a coin, but instead rolling a three-sided die with…
smandape
  • 1,033
  • 2
  • 14
  • 31
6
votes
2 answers

How to get HMM working with real-valued data in Tensorflow

I'm working with a dataset that contains data from IoT devices and I have found that Hidden Markov Models work pretty well for my use case. As such, I'm trying to alter some code from a Tensorflow tutorial I've found here. The dataset contains…
6
votes
2 answers

Confused about X in GaussianHMM.fit([X])

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 are you supposed to pass .fit() exactly?…
Brooks
  • 2,082
  • 2
  • 18
  • 26
6
votes
1 answer

Replicating the example of Markov Switching Model of Hamilton using MSwM package in R

I'm trying to estimate the basic Markov Switching Model of Hamilton (1989) as is post in E-views webpage. This model is itself is an exact replication of the existing in RATS. This is the time series of the example: gnp <-…
6
votes
1 answer

Gamma in the Baum Welch algorithm and float precision

I am currently trying to implement a Baum Welch algorithm in C, but I run into the following problem : the gamma function : gamma(i,t) = alpha(i,t) * beta(i,t) / sum over `i` of(alpha(i,t) * beta(i,t)) Unfortunately, for large enough observation…
Slereah
  • 257
  • 2
  • 13
6
votes
1 answer

Scikit Learn HMM training with set of observation sequences

I had a question about how I can use gaussianHMM in the scikit-learn package to train on several different observation sequences all at once. The example is here: visualizing the stock market structure shows EM converging on 1 long observation…
A.D
  • 1,480
  • 2
  • 18
  • 33
6
votes
5 answers

Scikit Learn Gaussian HMM: ValueError: startprob must sum to 1.0

I am currently working with Scikit Learn and have been running into the following issue while trying to train a Gaussian HMM: File "/Library/Python/2.7/site-packages/sklearn/hmm.py", line 443, in fit self._do_mstep(stats, self.params) File…
6
votes
1 answer

Gesture recognition using hidden markov model

I am currently working on a Gesture Recognition application, using a Hidden Markov Model as the classification stage on matlab(using webcam). I've completed the pre-processing part which includes extraction of feature vector. I've applied Principal…
6
votes
1 answer

Efficiently computing element wise product of transition matrices (m*m) * (n*n) to give (mn*mn) matrix

Consider input matrices X and Y of shapes (m,m) and (n,n) respectively. As an output we need to give a (mn,mn) shape matrix such that it multiplies corresponding entries in the two matrices. These two matrices X and Y represent transition matrices.…
Nipun Batra
  • 11,007
  • 11
  • 52
  • 77
6
votes
0 answers

Pickling a trained NLTK Model

So I am currently training a Hidden Markov Model on a set of surgical data like so: nltkTrainer = nltk.tag.hmm.HiddenMarkovModelTrainer(range(15),range(90)) model = nltkTrainer.train_unsupervised(data, max_iterations=3) If it's helpful, 'model' is…
tyleha
  • 3,319
  • 1
  • 17
  • 25
6
votes
1 answer

Hidden markov model in MATLAB

I have 11 states, and a transition probability matrix, but I don't have emissions as my model is not hidden. It consists only of states (1,2,3, ..., 11) I want to generate random states based on my transition probability matrix, but the HMM tool box…
Radwa Mohamed
  • 61
  • 1
  • 1
  • 2
5
votes
2 answers

How can HMMs be used for handwriting recognition?

The problem is a bit different than traditional handwriting recognition. I have a dataset that are thousands of the following. For one drawn character, I have several sequential (x, y) coordinates where the pen was pressed down. So, this is a…
5
votes
1 answer

Mallet HMM Training Problems

I am struggling at the moment with Mallet's ridiculously poor documentation regarding HMMs. I have managed to import the data into instances(adapted from the ImportExample.java snippet) and I was just wondering how they can be used to train an HMM…
Lezan
  • 667
  • 2
  • 7
  • 20
5
votes
0 answers

HMM for image sequence classification in OpenCV C++

I am trying to classify 9 types of crops (Y) from 5 satellite images (X), acquired at dates t = {t1,...,t5}, corresponding to 5 crop phrenology states (S) i.e. preparation, seeding, growing, harvesting and post-harvesting stages. I am using similar…
5
votes
1 answer

how to run hidden markov models in Python with hmmlearn?

I tried to use hmmlearn from GitHub to run a binary hidden markov model. This does not work: import hmmlearn.hmm as hmm transmat = np.array([[0.7, 0.3], [0.3, 0.7]]) emitmat = np.array([[0.9, 0.1], [0.2,…
lgd
  • 1,472
  • 5
  • 17
  • 35
1 2
3
34 35