Skip to Content
Hands-On Unsupervised Learning with Python
book

Hands-On Unsupervised Learning with Python

by Giuseppe Bonaccorso
February 2019
Intermediate to advanced
386 pages
9h 54m
English
Packt Publishing
Content preview from Hands-On Unsupervised Learning with Python

K-medoids

In the previous chapter, we have shown that K-means is generally a good choice when the geometry of the clusters is convex. However, this algorithm has two main limitations: the metric is always Euclidean, and it's not very robust to outliers. The first element is obvious, while the second one is a direct consequence of the nature of the centroids. In fact, K-means chooses centroids as actual means that cannot be part of the dataset. Hence, when a cluster has some outliers, the mean is influenced and moved proportionally toward them. The following diagram shows an example where the presence of a few outliers forces the centroid to reach a position outside the dense region:

Example of centroid selection (left) and medoid selection ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Unsupervised Learning Using Python

Hands-On Unsupervised Learning Using Python

Ankur A. Patel
Introduction to Machine Learning with Python

Introduction to Machine Learning with Python

Andreas C. Müller, Sarah Guido

Publisher Resources

ISBN: 9781789348279Supplemental Content