k-means clustering

k-means clustering is our first example of an unsupervised machine learning model. Remember this means that we are not making predictions; we are trying instead to extract structure from seemingly unstructured data.

Clustering is a family of unsupervised machine learning models that attempt to group data points into clusters with centroids.

Note

Definition

Cluster: This is a group of data points that behave similarly.Centroid: This is the center of a cluster. It can be thought of as an average point in the cluster.

The preceding definition can be quite vague, but it becomes specific when narrowed down to specific domains. For example, online shoppers who behave similarly might shop for similar things or at similar shops, whereas ...

Get Principles of Data Science - Second Edition 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.