Unsupervised Machine Learning Hidden Markov Models in Python (Udemy.com)
HMMs for stock price analysis, language modeling, web analytics, biology, and PageRank.
Created by: Lazy Programmer Team
Last updated August 2026
What you will learn
- Understand and enumerate the various applications of Markov Models and Hidden Markov Models
- Understand how Markov Models work
- Write a Markov Model in code
- Apply Markov Models to any sequence of data
- Understand the mathematics behind Markov chains
- Apply Markov models to language
- Apply Markov models to website analytics
- Understand how Google's PageRank works
- Understand Hidden Markov Models
- Write a Hidden Markov Model in Code
- Write a Hidden Markov Model using Theano
- Understand how gradient descent, which is normally used in deep learning, can be used for HMMs
How it compares
Against the other 155 rated Udemy courses in Machine Learning on CourseDuck:
- Rating4.4 out of 5higher than 49% of them
- Reviews4,436#21 of 156 by number of reviews
- Length9.8 hourslonger than 61% of them
- Last updatedAugust 2026more recently than 90% of them
Course Description
The Hidden Markov Model or HMM is all about learning sequences.
A lot of the data that would be very useful for us to model is in sequences. Stock prices are sequences of prices. Language is a sequence of words. Credit scoring involves sequences of borrowing and repaying money, and we can use those sequences to predict whether or not you’re going to default. In short, sequences are everywhere, and being able to analyze them is an important skill in your data science toolbox.
The easiest way to appreciate the kind of information you get from a sequence is to consider what you are reading right now. If I had written the previous sentence backwards, it wouldn’t make much sense to you, even though it contained all the same words. So order is important.
While the current fad in deep learning is to use recurrent neural networks to model sequences, I want to first introduce you guys to a machine learning algorithm that has been around for several decades now - the Hidden Markov Model.
This course follows directly from my first course in Unsupervised Machine Learning for Cluster Analysis, where you learned how to measure the probability distribution of a random variable. In this course, you’ll learn to measure the probability distribution of a sequence of random variables.
You guys know how much I love deep learning, so there is a little twist in this course. We’ve already covered gradient descent and you know how central it is for solving deep learning problems. I claimed that gradient descent could be used to optimize any objective function. In this course I will show you how you can use gradient descent to solve for the optimal parameters of an HMM, as an alternative to the popular expectation-maximization algorithm.
We’re going to do it in Theano and Tensorflow, which are popular libraries for deep learning. This is also going to teach you how to work with sequences in Theano and Tensorflow, which will be very useful when we cover recurrent neural networks and LSTMs.
This course is also going to go through the many practical applications of Markov models and hidden Markov models. We’re going to look at a model of sickness and health, and calculate how to predict how long you’ll stay sick, if you get sick. We’re going to talk about how Markov models can be used to analyze how people interact with your website, and fix problem areas like high bounce rate, which could be affecting your SEO. We’ll build language models that can be used to identify a writer and even generate text - imagine a machine doing your writing for you. HMMs have been very successful in natural language processing or NLP.
We’ll look at what is possibly the most recent and prolific application of Markov models - Google’s PageRank algorithm. And finally we’ll discuss even more practical applications of Markov models, including generating images, smartphone autosuggestions, and using HMMs to answer one of the most fundamental questions in biology - how is DNA, the code of life, translated into physical or behavioral attributes of an organism?
All of the materials of this course can be downloaded and installed for FREE. We will do most of our work in Numpy and Matplotlib, along with a little bit of Theano. I am always available to answer your questions and help you along your data science journey.
This course focuses on "how to build and understand", not just "how to use". Anyone can learn to use an API in 15 minutes after reading some documentation. It's not about "remembering facts", it's about "seeing for yourself" via experimentation. It will teach you how to visualize what's happening in the model internally. If you want more than just a superficial look at machine learning models, this course is for you.
See you in class!
"If you can't implement it, you don't understand it"
Or as the great physicist Richard Feynman said: "What I cannot create, I do not understand".
My courses are the ONLY courses where you will learn how to implement machine learning algorithms from scratch
Other courses will teach you how to plug in your data into a library, but do you really need help with 3 lines of code?
After doing the same thing with 10 datasets, you realize you didn't learn 10 things. You learned 1 thing, and just repeated the same 3 lines of code 10 times...
Suggested Prerequisites:
calculus
linear algebra
probability
Be comfortable with the multivariate Gaussian distribution
Python coding: if/else, loops, lists, dicts, sets
Numpy coding: matrix and vector operations, loading a CSV file
WHAT ORDER SHOULD I TAKE YOUR COURSES IN?:
Check out the lecture "Machine Learning and AI Prerequisite Roadmap" (available in the FAQ of any of my courses, including the free Numpy course)
Instructor Details
- 4.4 Rating
4,436 Reviews
Lazy Programmer Team
The Lazy Programmer is a seasoned online educator with an unwavering passion for sharing knowledge. With over 10 years of experience, he has revolutionized the field of data science and machine learning by captivating audiences worldwide through his comprehensive courses and tutorials.
Equipped with a multidisciplinary background, the Lazy Programmer holds a remarkable duo of master's degrees. His first foray into academia led him to pursue computer engineering, with a specialized focus on machine learning and pattern recognition. Undeterred by boundaries, he then ventured into the realm of statistics, exploring its applications in financial engineering.
Recognized as a trailblazer in his field, the Lazy Programmer quickly embraced the power of deep learning when it was still in its infancy. As one of the pioneers, he fearlessly embarked on instructing one of the first-ever online courses on deep learning, catapulting him to the forefront of the industry.
More courses by Lazy Programmer Team
Artificial Intelligence: Reinforcement Learning in Python (2026)
4.9 (10,817 Reviews)
Provider: Udemy
Time: 14.7h
$79.99
Advanced AI: Deep Reinforcement Learning in Python (2026)
4.8 (6,557 Reviews)
Provider: Udemy
Time: 10.7h
$29.99
Cluster Analysis and Unsupervised Machine Learning in Python (2026)
4.7 (5,236 Reviews)
Provider: Udemy
Time: 8h
$29.99
Deep Learning Prerequisites: The Numpy Stack in Python V2 (2026)
4.4 (3,835 Reviews)
Provider: Udemy
Time: 2h
Free
Data Science: Supervised Machine Learning in Python (2026)
4.7 (3,555 Reviews)
Provider: Udemy
Time: 6.4h
$29.99
Deep Learning: GANs and Variational Autoencoders (2026)
4.7 (3,387 Reviews)
Provider: Udemy
Time: 7.9h
$29.99
More Machine Learning courses
Automated Machine Learning with AutoGluon Library in Python (2023)
4.8 (157 Reviews)
Provider: Udemy
Time: 5.5h
$84.99
Complete A.I. & Machine Learning, Data Science Bootcamp (2026)
4.7 (30,982 Reviews)
Provider: Udemy
Time: 44h
$129.99
Bayesian Machine Learning in Python: A/B Testing (2026)
4.7 (8,053 Reviews)
Provider: Udemy
Time: 10.4h
$109.99
[2026] Machine Learning: Natural Language Processing (V2)
4.7 (7,251 Reviews)
Provider: Udemy
Time: 23.5h
$99.99
Reviews
By Dusan Perovic on 3/7/2021
As a someone who did not have a chance to encounter with HMMs earlier, this course was a huge surprise. The way how instructor approached to the topic and explanations is for huge praise. Theory is important to understand in order to try do some practical stuffs. This course and instructor will have impact on my further research in the field of HMM implementation from both theoretical and practical aspect. Patience is also important in succeeding this course alongside good understanding. It was really above expectations and after this learning curve will definitely still be on upward path.
By Vladimir Avanesyan on 1/12/2021
Hidden Markov Models introductory sections are good, the core Hidden Markov Model Discrete Observation section is just excellent. The rest of the course unfortunately doesn't have the same integrity and depth. Sections are briefly presented and not easy to understand without extensive and time consuming Internet research. TensorFlow 1.0 and Theano code looks a bit heavy-weighted. The gmm/hmm API libraries like scikit-learn, hmmlearn etc. are left ouf of the course scope. I studied them in parallel on my own and found it very useful. The minus to mention is that the author doesn't provide course slides for download as reference, at least I didn't find them. In general 4 stars.
By Yuktha J S on 10/6/2020
Good
By Ajitkumar Poolathodiyil on 8/22/2020
Thank you for the course. However I find some of the contents are very cryptic in nature inside the code. In some places in code please provide clear comments at a pseudologic level for instance in: (1) for loops j then another loop inside - why there are 3 loops? (i will re-run and try again to understand) and (2) np.zeros, np.ones and np.eye(D) and then divide by array - Is it normalization, what is this division for? It would be nice to explain in a slide about what np.eye(D) really means. I will review numpy again and dig this. Also there are some greek alphabets alpha, beta. here could you provide what is alphas and betas purpose. Are you aggregating, why is this required? what is mu an sigma, may be I will repeat lagrangian multiplication, however I think it doesn't hurt to cover the points like alphas, betas, mu and sigma in a greek notations appendix slide or something like that in the next slide. I think subject its my level of understanding here as its my first run of the course and HMM topic.. So subject explanation needs to be given more weight age against code. For instance, does fit coin mean..fitting the model to sequence of coin tosses? I didnt get it, I will try and revisit it. On style of code walkthrough its great from a IT perspective. However, my 2 cents, It would be great to have a tell-show-tell approach as against tell-as-you-code approach. There is no need to code along, step-1: just tell pseudo logic, then step-2: show code while walk through without typing with little explaining and finally in step-3: tell about more as needed and go ahead run code. Subject by nature is complex, In fact you could give more whitepaper references, like point to experts who have published papers Also plant some quizes at the completion of each section, every kid likes a quiz! I have never seen anyone touch the order of data science courses covered like you did. This is great and I liked it very much.
By Christiane Hller on 8/16/2020
Excellent theoretical introduction!
By Josip Lazarevski on 7/14/2020
The style of lecturing/ the git hub content managing is really poor.
Maybe he has knowledge of the topic but he needs to polish how he is managing and transferring its knowledge.
By Lafi alnufaie on 7/12/2020
C'est tres bien de course.
J'ai compris beaucoup des choses.
Merci
By Thibault Lucidarme on 6/21/2020
Great subject. I enjoyed the mathematics.
The implementation was too confusing: the python does not match the previously derived formulas (specifically gamma and xi). The variables used become too numerous to not be named specifically. formulas with plethora of single letter variables just become too hard to make sense.
I knew what GMM are but the part on HMM+GMM still does not make sense to me (why, reasonning, when to use, what is the interpretation).
During examples, the result is only ever shown to be the loglikelihood. never actual classification/prediction/modelisation. e.g. the example on the 2 poets could be really fun but al that is shown is the final likelihood. disappointing
By Thibault Lucidarme on 6/11/2020
Great subject. I enjoyed the mathematics. The implementation was too confusing: the python does not match the previously derived formulas (specifically gamma and xi). The variables used become too numerous to not be named specifically. formulas with plethora of single letter variables just become too hard to make sense. I knew what GMM are but the part on HMM+GMM still does not make sense to me (why, reasonning, when to use, what is the interpretation). During examples, the result is only ever shown to be the loglikelihood. never actual classification/prediction/modelisation. e.g. the example on the 2 poets could be really fun but al that is shown is the final likelihood. disappointing
By Aman Singh on 5/22/2020
Great
By Sayantan Dutta on 5/22/2020
Another high-quality course easily at par with top university grad/research level courses. The course has very dense level mathematics and technical materials, and they are explained quite well. Not suited for beginners, but advanced-level practitioners would relish it.
By Shilpi on 5/20/2020
The content is really amazing.
I was expecting for some assignments after each section to make this more interactive
Quality Score
No CourseDuck member has rated this course yet. Taken it? Give each part a thumbs up or down.
Overall Score : 88 / 100











![[2026] Machine Learning: Natural Language Processing (V2)](/programming/machine-learning/images/4294434_daf2_5.jpg?v=1789268237)
