Coconote
AI notes
AI voice & video notes
Export note
Try for free
Machine Learning Algorithms: K-Means Clustering
Jul 10, 2024
Machine Learning Algorithms: K-Means Clustering
Overview
Categories of ML Algorithms
:
Supervised Learning
Unsupervised Learning
Reinforcement Learning
Today's focus:
Unsupervised Learning
(specifically K-Means Clustering)
K-Means Clustering
Objective
: Identify clusters in a dataset without class labels.
Steps
:
Start with defining
k
(number of clusters).
Randomly set
k
centroids in the 2D space.
Assign each data point to the nearest centroid, forming initial clusters.
Adjust centroids to the mean position of associated data points.
Repeat the process until data points no longer change clusters.
Visual Example
Given a 2D dataset with no class labels.
Visual examination suggests two clusters.
Initial random centroids -> Assign points to closest centroid -> Adjust centroids -> Repeat till convergence.
Choosing
k
with Elbow Method
Elbow Method
: Helps determine the optimal
k
.
Calculate Sum of Square Error (SSE) for varying values of
k
.
Plot SSE vs.
k
and look for the
📄
Full transcript