K-means 

K-means is a method of clustering data. The problem is posed as this—given a dataset of N items, we wish to partition the data into K groups. How do you do so?

Allow me to take a side bar and explore the wonderful world of coordinates. No, no, don't run! It's very visual.

Which line is longer? How do you know?

You know which line is longer because you can measure each line from points a, b, c, and d. Now, let's try something different:

Which dot is closest to X? How do you know?

You know because again, you can measure the distance ...

Get Go Machine Learning Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.