Machine LearningLesson 87Free preview
K-means
This lesson is part of Python · All levels
Summary
K-means is an unsupervised learning algorithm that groups data into k clusters based on their proximity to the centroid. How do you do it: determine the number of k clusters, place the centroid randomly, then re-assign the data to the nearest centroid and recalculate the centroid until it's stable. The number of k clusters is a hyperparameter that must be determined before training, often aided by the elbow method. K-means are widely used for customer segmentation and data grouping without labels.
Key points
- K-means is an unlabelled clustering algorithm.
- The number of k clusters must be determined before the model is trained
- Iteration: data to the nearest centroid and then the centroid is recalculated
- The elbow method helps to select the right number of clusters
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.