Computer scienceData scienceInstrumentsScikit-learnTraining ML models with scikit-learnClustering in scikit-learn

Agglomerative clustering in scikit-learn

Running through the linkages

Report a typo

Note that this task assumes scikit-learn version 1.2.2

We are working with the following 2D dataset (should be downloaded to solve this task):

The original data plot

You have the following starter code:

from sklearn.preprocessing import StandardScaler
from sklearn.cluster import AgglomerativeClustering

data = np.load('clusterable_data.npy') # assuming the downloaded file is saved in the working directory
scale = StandardScaler()
reduced_X = scale.fit_transform(data)

Fit AgglomerativeClustering() with n_clusters = 6 and 4 different linkages: Ward's linkage, average linkage, complete linkage, and single linkage. Plot the clustering results for each linkage. Which linkage produces the most imbalanced clusters?

Select one option from the list
___

Create a free account to access the full topic