Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for some python implementation (in pure python or wrapping existing stuffs) of HMM and Baum-Welch.

Some ideas?

I've just searched in google and I've found really poor material with respect to other machine learning techniques. Why?

share|improve this question

The scikit-learn has an HMM implementation. It was until recently considered as unmaintained and its usage was discouraged. However it has improved in the development version. I cannot vouch for its quality, though, as I know nothing of HMMs.

Disclaimer: I am a scikit-learn developer.

Edit: we have moved the HMMs outside of scikit-learn, to

share|improve this answer
yeah i decide to don't use it because of unmantainement.. – nkint Mar 11 '12 at 18:29
I think that it is improving and that we will soon be able to commit to maintaining it. – Gael Varoquaux Mar 11 '12 at 19:03
does the sklearn implementation use Baum-Welch? – Vishal Sep 24 '12 at 13:03
Yes it does. See _BaseHMM documentation for implementation details. – Sergei Lebedev Mar 1 at 11:04

Have you seen NLTK?

It has some classes that are suitable for this sort of thing, but somewhat application dependent.

If you are looking for something more 'education oriented', I wrote toy trainer a while ago:

share|improve this answer
thanks. i need it for gesture recognition. i'm stucked on what could be my alphabet (symbols in nltk) in my application.. – nkint Jan 19 '12 at 11:40
@nkint Check this out: – qi5d02lx Jan 19 '12 at 11:47
ok the data are the labels so if i use only 8 labels for clusterize the coordinates of a gesture.. alphabet is [1,2,3,4,5,6,7] – nkint Jan 19 '12 at 17:16
but still don't understand the difference between state and symbol in HiddenMarkovModelTrainer constructor – nkint Jan 19 '12 at 18:15
alright, how about this:… it's a step-by-step demo with code of how to build your own gesture recognizer with the kinect. code is for Octave not python, but it seems like you are stuck on the ideas/implementation more than the particulars of the software. of course it requires a kinect... you might also check this out: – qi5d02lx Jan 19 '12 at 23:40

Some implementation of basic algorithms (including Baum-welch in python) are available here:

share|improve this answer

The General Hidden Markov Model library has python bindings and uses the Baum-Welch algorithm.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.