Book Image

Principles of Data Science - Second Edition

By : Sinan Ozdemir, Sunil Kakade, Marco Tibaldeschi
Book Image

Principles of Data Science - Second Edition

By: Sinan Ozdemir, Sunil Kakade, Marco Tibaldeschi

Overview of this book

Need to turn programming skills into effective data science skills? This book helps you connect mathematics, programming, and business analysis. You’ll feel confident asking—and answering—complex, sophisticated questions of your data, making abstract and raw statistics into actionable ideas. Going through the data science pipeline, you'll clean and prepare data and learn effective data mining strategies and techniques to gain a comprehensive view of how the data science puzzle fits together. You’ll learn fundamentals of computational mathematics and statistics and pseudo-code used by data scientists and analysts. You’ll learn machine learning, discovering statistical models that help control and navigate even the densest datasets, and learn powerful visualizations that communicate what your data means.
Table of Contents (17 chapters)
16
Index

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; instead, we are trying 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 similar software companies might make comparable software at comparable prices.

Here is a visualization of clusters of points:

k-means clustering

In the preceding diagram, our human brains can very easily see the difference between the four clusters. We can see that...