Week 7 Lecture 1.5
Clustering
- Categorizing elements by a notion of similarity.
- We have no labels, the training will be unsuperwised
- Categories emerge from the similarity criteria
- good for around and out
K-means problem
- Finding the center point for each category (clusters)
is for the Euclidian distance.
is defined as the sum of (squared) distances between every point and their nearest point in
The problem itself is to find the two sets that minimizes the function.
- Elements in may not be elements of
- The problem itself is NP-hard (even the approximation)
- we will treat the special case of
solved when called a centroid (stands for center of mass geometrically speaking)
k-means algorithm
- Place random centerpoints to form the first clusters
- Re-calculate the center point to better fit that one partition. (doesnβt need to be globally correct)
- Rinse and repeat
Should converge in finite iterations
- β¦ to a locally optimal clustering
Notes from Sadegh:
- Simple, and relatively efficient*
- Fast convergence in practice
- needs
- local optimum can be really bad
- outliers and heuristics matters a lot
seeding methods: k-means++
Common remedies for the root problems of k-means:
- run it multiple times, select the best
algorithm
Place each starting point one-by-one:
- Starting point is selected from the data at random
- Each point has the probability of being selected equal to the distance from the closest center point
- Run the original k-means with this setup