Skip to main content
100%

clustering

✓ Published0🌍 Public
AAlsaxian
Last edited Jan 27, 2018
Created on Jan 27, 2018

This example applies scikit-learn clustering to crime data, displaying how K-means and agglomerative clustering group observations. It first shows K-means with three clusters inside a pipeline that standardizes the data and reduces it to three principal components, then displays the resulting cluster centers and cumulative explained variance. A separate step uses AgglomerativeClustering with Ward linkage to assign four clusters to city data projected onto its first two principal components. The visualization relies on standard scaler, PCA, KMeans, and AgglomerativeClustering from the sklearn.cluster and sklearn.pipeline modules.

AI-generated description

Similar vizzes