July 2017
Intermediate to advanced
360 pages
8h 26m
English
Let's consider a more complex dummy dataset with 8 centers:
>>> nb_samples = 3000>>> X, _ = make_blobs(n_samples=nb_samples, n_features=2, centers=8, cluster_std=2.0)
A graphical representation is shown in the following figure:

We can now perform an agglomerative clustering with different linkages (always keeping the Euclidean distance) and compare the results. Let's start with a complete linkage (AgglomerativeClustering uses the method fit_predict() to train the model and transform the original dataset):
from sklearn.cluster import AgglomerativeClustering>>> ac = AgglomerativeClustering(n_clusters=8, ...
Read now
Unlock full access