CSC 411 Lecture 15: K-Means
Roger Grosse, Amir-massoud Farahmand, and Juan Carrasquilla
University of Toronto
CSC411 Lec15 1 / 18
CSC 411 Lecture 15: K-Means Roger Grosse, Amir-massoud Farahmand, - - PowerPoint PPT Presentation
CSC 411 Lecture 15: K-Means Roger Grosse, Amir-massoud Farahmand, and Juan Carrasquilla University of Toronto CSC411 Lec15 1 / 18 Motivating Examples Some examples of situations where youd use unupservised learning You want to
CSC411 Lec15 1 / 18
◮ You want to understand how a scientific field has changed over time.
◮ You’re a biologist studying animal behavior, so you want to infer a
◮ You want to reduce your energy consumption, so you take a time series
CSC411 Lec15 2 / 18
◮ Today’s lecture: K-means, a simple algorithm for clustering, i.e.
◮ Next 2 lectures: reformulate clustering as a latent variable model,
CSC411 Lec15 3 / 18
◮ This is an overly simplistic model — more on that later CSC411 Lec15 4 / 18
CSC411 Lec15 5 / 18
CSC411 Lec15 6 / 18
◮ Assignment step: Assign each data point to the closest cluster ◮ Refitting step: Move each cluster center to the center of gravity of the
CSC411 Lec15 7 / 18
Figure from Bishop Simple demo: http://syskall.com/kmeans.js/ CSC411 Lec15 8 / 18
{m},{r} J({m}, {r}) =
{m},{r} N
K
k ||mk − x(n)||2
k
k
k
◮ Fix centers, optimize assignments (choose cluster whose mean is
◮ Fix assignments, optimize means (average of assigned datapoints) CSC411 Lec15 9 / 18
◮ Assignment: Each data point x(n) assigned to nearest mean
k d(mk, x(n))
k
◮ Refitting: Model parameters, means are adjusted to match sample
k x(n)
k
CSC411 Lec15 10 / 18
Figure from Bishop CSC411 Lec15 11 / 18
CSC411 Lec15 12 / 18
CSC411 Lec15 13 / 18
◮ Simultaneously merge two nearby
◮ and split a big cluster into two
CSC411 Lec15 14 / 18
◮ Allows a cluster to use more information about the data in the refitting
◮ What happens to our convergence guarantee? ◮ How do we decide on the soft assignments? CSC411 Lec15 15 / 18
◮ Assignment: Each data point n given soft ”degree of assignment” to
k
◮ Refitting: Model parameters, means, are adjusted to match sample
k x(n)
k
CSC411 Lec15 16 / 18
CSC411 Lec15 17 / 18