Перейти к содержимому

K-Means Clustering Explained, Step by Step

Harban AI LABS

0:00 / 0:00

K-Means Clustering Explained, Step by Step

7 просмотров · 9 дн. назад
Harban AI LABS
46 подписчиков
7 просмотров · 9 дн. назад
K-means clustering explained step by step: assign points, move centroids, choose k (elbow method), unsupervised learning. K-means is the first unsupervised algorithm of this playlist: there are no labels, and the task is to find groups. The whole algorithm is two moves that repeat: assign every point to its nearest centre, then move every centre to the mean of its points. This video shows a real run step by step, a tiny example by hand, what the algorithm minimises, how to choose k honestly, and where k-means fails. You will learn: The two moves, animated on a real run with the true centre positions at every round A full example by hand on six numbers, with every number computed The inertia (within-cluster sum of squares) and why it can never go up Bad starts and local optima, n_init and k-means++ Choosing k: the elbow plot, why inertia always falls as k grows, and the silhouette score Where k-means fails: different sizes, long clouds, two moons Why you scale first, and the parameters n_clusters, init, n_init, max_iter, random_state Why the result is a description, not a truth All data in this video are made up for teaching. Chapters 0:00 No labels: can an algorithm find the groups? 0:40 The two moves: assign and update 1:29 A tiny example by hand 2:15 What it minimises: the inertia 3:07 A question: is the result always the best? 3:19 Bad starts, n_init and k-means++ 4:13 Choosing k: the elbow plot, honestly 4:49 The silhouette score 5:29 Where k-means fails 6:04 Scale first, and the parameters 6:48 Recap + try it yourself Try it yourself: four numbers on a line, 1, 3, 8 and 10. k = 2, and the centres start at 1 and 3. Run the two moves by hand until nothing changes. (1) Where do the centres end? (2) What is the final inertia? Animations made with Manim Community Edition. The narration is a synthetic voice. #MachineLearning #KMeans #AIEngineer More from Harban AI Labs: https://harban-ai-labs.vercel.app/