August 2018
Intermediate to advanced
522 pages
12h 45m
English
To better understand the agglomeration process, it's useful to introduce a graphical method called a dendrogram, which shows in a static way how the aggregations are performed, starting from the bottom (where all samples are separated) to the top (where the linkage is complete). Unfortunately, scikit-learn doesn't support it. However, SciPy provides some useful built-in functions.
Let's start by creating a dummy dataset:
from sklearn.datasets import make_blobsnb_samples = 25X, Y = make_blobs(n_samples=nb_samples, n_features=2, centers=3, cluster_std=1.5)
To avoid excessive complexity in the resulting plot, the number of samples has been kept very low. In the following graph, there's a representation of the dataset:
Read now
Unlock full access