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

Comparison between mini-batch K-means and BIRCH

In this example, we want to compare the performances of both algorithms with a bidimensional dataset containing 2,000 samples split into 8 blobs (as the purpose is analytic, we are also using the ground truth), as follows:

from sklearn.datasets import make_blobsnb_clusters = 8nb_samples = 2000X, Y = make_blobs(n_samples=nb_samples, n_features=2, centers=nb_clusters,                  cluster_std=0.25, center_box=[-1.5, 1.5], shuffle=True, random_state=100)

The dataset (which is already shuffled to remove any inter-correlation in the streaming process) is shown in the following screenshot:

Bidimensional dataset ...
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