Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
2027 Unsupervised Learning in Python: Cluster Analysis & PCA
Highest Rated
Hot & New
Rating: 5.0 out of 5(18 ratings)
52 students

2027 Unsupervised Learning in Python: Cluster Analysis & PCA

Cluster analysis, PCA, anomaly detection, fraud detection, recommendation systems and text clustering with Ollama LLMs
Last updated 11/2026
English
English

What you'll learn

  • Explain unsupervised, supervised and semi-supervised learning, and where clustering, dimensionality reduction and anomaly detection fit in a project
  • Find your way around scikit-learn and use any of its models in four steps: import, make, fit and use, with the User Guide and API pages as your map
  • Reduce dimensions with PCA, t-SNE and UMAP on MNIST digits, choose how many components to keep, and rebuild digits from them
  • Detect credit card fraud with no labels using PCA error, Isolation Forest, LOF and ECOD, and grade it with average precision and a review budget
  • Run cluster analysis with k-means, hierarchical clustering, DBSCAN, HDBSCAN and Gaussian mixtures, and segment customers into groups a team can use
  • Judge clusters without labels using the elbow method, the silhouette score, purity and the adjusted Rand index
  • Train autoencoders in Keras for anomaly detection, then add a few labels with semi-supervised learning and self-training
  • Cluster time series such as ECG heartbeats with shape-based distance, Dynamic Time Warping and k-Shape
  • Build a recommendation system on MovieLens with RecTools: item similarity, ALS, EASE and SASRec, graded with recall at 10 and NDCG at 10
  • Cluster text with sentence embeddings, UMAP, HDBSCAN and BERTopic, and name the groups with a local LLM running in Ollama

Course content

11 sections • 149 lectures • 6h 19m total length
  • Welcome: What You Will Learn in Unsupervised Learning in Python3:39

    What unsupervised learning is, the nine sections you will go through, from the map of the field and scikit-learn to recommenders and text clustering, how each lesson pairs the running notebook with an animated scene of the real data, and who the course is for.

  • Meet Your Instructor1:59

    Who Laxmi Kant is, the work he does as an AI engineer and corporate AI trainer, and why every method in this course runs for real on real data.

  • How to Get the Most Out of This Course3:06

    How the eight sections, slide decks and notebooks fit together, and a study method: watch, run it yourself, then change one thing.

  • Set Up Your Video Player1:40

    The Udemy player settings that make code easy to read: quality and full screen, speed, captions and transcript, notes and offline viewing.

  • Course Resources and Setup: Python, uv and Ollama3:44

    Where to get the course repository, and the one-time setup: Python 3.12, uv, running the notebooks, what each dataset downloads, and Ollama for the last section.

  • Ratings, Q&A and Staying in Touch1:29

    How to leave an honest rating, how to use the Q&A, and where the announcements about new sections appear.

Requirements

  • Basic Python: if you can read a short script, you can follow every code lecture. Every line we type is explained
  • A computer where you can install Python 3.12 and uv, and an internet connection: every dataset downloads inside its notebook (the credit card file is about 144 MB and downloads each time its notebook runs)
  • Ollama, installed only for the last section, to run a small language model on your own computer. The setup lesson shows the one command
  • No machine learning background is needed: the first section explains the ideas in plain words. No GPU, no account and no API key is needed

Description

This course contains the use of artificial intelligence. The course outline, the explanations, the tool choices and every measured number are my own.

Learn unsupervised machine learning in Python on real data that has no labels. In this hands-on course you use scikit-learn, UMAP, PyOD, Keras, PyTorch, aeon, implicit, BERTopic and Ollama for cluster analysis, PCA and other dimensionality reduction, anomaly detection, credit card fraud detection, autoencoders, semi-supervised learning, time series clustering, recommendation systems and text clustering with a local LLM.

Most real data comes without an answer key. Nobody has marked which customers belong together, which transactions are fraud, which heartbeats look alike, which movie a user will want next or what a pile of bank messages is about. Unsupervised learning is how you find structure in data like this: you compress it, group it, rank what looks unusual and learn representations that other models build on, and then you decide what to do with it.

Unsupervised Learning in Python teaches each method one step at a time. You start with a map of where unsupervised learning sits in machine learning, with no code. Then you work through seven code sections of notebooks on real data: handwritten digits, credit card transactions, wholesale customers, heartbeat recordings, MovieLens movie watches and bank customer messages. New sections keep coming to the course.

What makes this course different

  • Fraud detection without labels. You score 284,807 real card transactions, of which only 0.17% are fraud, with PCA reconstruction error, Isolation Forest, Local Outlier Factor and ECOD, then with autoencoders. You grade every score with average precision, the precision-recall curve and a daily review budget, because plain accuracy fails on rare fraud.

  • Cluster analysis, start to finish. k-means, hierarchical clustering and the dendrogram, DBSCAN, HDBSCAN and Gaussian mixtures on 10,000 handwritten digits, then customer segmentation of 440 wholesale customers into segments a sales team can use.

  • Many ways to reduce dimensions. PCA, Incremental PCA, Sparse PCA, Kernel PCA, Truncated SVD, random projection, ICA, dictionary learning, Isomap, MDS, LLE, t-SNE and UMAP, all on MNIST digits, with a lecture on choosing between them.

  • A recommendation system built the way it is built now. On MovieLens 1M (6,040 users and 3,706 movies) you build a popularity baseline, item-based collaborative filtering with cosine similarity, matrix factorization with implicit ALS, EASE, which is a linear autoencoder over items, and SASRec, a small transformer that you write in PyTorch to predict the next movie. You hold out each user's last 10 movies and grade every model with recall at 10 and NDCG at 10. In my run, the popularity list scores 0.041 recall at 10 and SASRec scores 0.159.

  • Text clustering with embeddings and a local LLM. You turn 10,003 bank customer messages into embeddings with a small sentence-transformers model, group them with k-means, with UMAP and HDBSCAN, and with BERTopic, and then ask a small language model, Qwen3.5 4B on Ollama, to name the groups. It runs on your own computer, with no API key and no account.

  • Honest results. You see methods fail and learn why: standardizing hurts the fraud features, Local Outlier Factor misses grouped fraud, k-means fails on shifted heartbeats, wide autoencoders give different scores from run to run, and on the bank messages UMAP with HDBSCAN scores lower than k-means that is told the right number of groups, so you learn what a score hides.

  • Judging results with no answer key: purity, the adjusted Rand index, the elbow method, the silhouette score, a daily review budget, and recall at 10 and NDCG at 10 on held-out watches, with the labels used only for grading.

  • Every line of code is typed and explained on screen, and the real output is read out, so you can follow along and run it yourself. Every dataset downloads inside its notebook, with no account or login.

What you will cover

  • The map: rules versus machine learning, supervised, semi-supervised and reinforcement learning, the five families of unsupervised learning, how to judge results without labels, and self-supervised learning.

  • Dimensionality reduction in Python: PCA, t-SNE and UMAP on MNIST digits, and the other methods listed above.

  • Anomaly detection: credit card fraud detection with reconstruction error, Isolation Forest, Local Outlier Factor and ECOD, and an honest check on the test set.

  • Cluster analysis: k-means, hierarchical clustering, DBSCAN, HDBSCAN, Gaussian mixtures, UMAP before HDBSCAN, and customer segmentation.

  • Autoencoders in Keras 3 on the PyTorch backend, and semi-supervised learning with a few labels: the reconstruction error as a feature, self-training and pseudo-labels.

  • Time series clustering: ECG heartbeats, why Euclidean distance fails on a shifted beat, shape-based distance, Dynamic Time Warping, k-Shape and HDBSCAN.

  • Recommender systems: implicit feedback, a time-based split, the popularity baseline, item similarity, implicit ALS, EASE and SASRec, and how to choose between them.

  • Text clustering: text embeddings with sentence transformers, k-means on embeddings, UMAP and HDBSCAN, BERTopic topic modeling, naming clusters with a local LLM in Ollama, sorting new messages and turning clusters into a labeled dataset.

By the end, you will be able to take a table, a signal, a pile of transactions, a log of what people watched or a stack of messages with no labels, find groups, unusual rows, recommendations and compact representations in it, and judge how far to trust each result.

A little Python is enough. You do not need a machine learning background, and a GPU is optional: everything in this course also runs on a CPU. Training the SASRec model is the one step that takes noticeably longer without a GPU, and the small language model in Ollama runs on a plain processor, only more slowly.

Who this course is for:

  • Beginners in machine learning who want to understand unsupervised learning from the first idea to working Python code
  • Python developers and data analysts who have tables, transactions, signals or text with no labels and want to find groups, patterns and unusual rows
  • Data scientists and machine learning engineers who want practical anomaly detection and fraud detection, clustering, dimensionality reduction, recommender systems and text clustering in one place
  • Anyone who wants to build a recommendation system from what people watched, or to sort support tickets, reviews or survey answers into topics without labeling them first
  • Students and career changers who want data science projects built on real datasets
  • Not for you if you want supervised learning from scratch: labels appear here only to grade the results