Mean Shift Clustering on Wine (UCI wine recognition)

Mean Shift Clustering on Wine (UCI wine recognition) produced 2 clusters and 0 noise rows (silhouette 0.224, adjusted Rand -0.006 against held-out wine_class).

Results of this run

Mean Shift modes on Wine (UCI wine recognition) use bandwidth 4.0933 (quantile 0.3). Mode-seeking silhouette is 0.224, mode Calinski-Harabasz is 6.4, mode Davies-Bouldin is 1.320. The modes recover held-out wine_class at adjusted Rand -0.006. 0 noise rows out of 178 remain. Mode 0 on Wine (UCI wine recognition) holds 174 rows (magnesium 98.84 / proline 747.0). Mode 1 on Wine (UCI wine recognition) holds 4 rows (magnesium 139.0 / proline 741.8). Mean Shift bandwidth check: bandwidth 4.0933 returns 0.224 with 2 groups on Wine (UCI wine recognition). Mode plot variance kept: 55.4%.

Mean Shift Clustering on Wine (UCI wine recognition): PCA plot of 2 clusters and 0 noise rows
Each point is one row. Gray points are noise. Computed 2026-11-02 with scikit-learn 1.4.2.
bandwidthSilhouetteClusters
4.09330.2242
from sklearn.cluster import MeanShift, estimate_bandwidth
from sklearn.preprocessing import StandardScaler
Xs = StandardScaler().fit_transform(X)
bandwidth = estimate_bandwidth(Xs, quantile=0.3, random_state=42)
labels = MeanShift(bandwidth=bandwidth, bin_seeding=True, cluster_all=True).fit_predict(Xs)

Who, how, and why

Method: StandardScaler, drop constant columns. Code version 3e4afc4b4352 (scripts/seo/build_explore_artifacts.py). scikit-learn 1.4.2. Seed 42. Dataset source: UCI Machine Learning Repository, wine recognition. License: CC BY 4.0. The wine_class column was held out of the fit and used only for the adjusted Rand score.

Results computed on 2026-11-02.

The results paragraph is filled from these numbers by a fixed template in the site code, so the scores can be checked against the same dataset in the tool.

Maintainer: nikolaou1982.

Contact: nick1982100@gmail.com.

How Mean Shift Clustering Works

Mean Shift finds cluster centers by iteratively shifting points toward local density maxima. It discovers the number of clusters automatically.

About the Wine (UCI wine recognition) Dataset

178 samples and 13 chemical measurements from three cultivars. The column held out of clustering is the cultivar, not a quality score. Source: UCI Machine Learning Repository, wine recognition. License: CC BY 4.0.

Samples. 178

Features. 13

Type. Numeric

Category. Density-based

When to Use Mean Shift Clustering

Mean Shift Clustering belongs to the Density-based family of clustering algorithms. These methods identify clusters as regions of high point density separated by regions of low density. They can discover clusters of arbitrary shape.

Related Examples

Ready to try Mean Shift Clustering on your own data?

Upload a CSV and get instant results — free to start.