K-Means on the 200-row Mall Customers tutorial table. The loader, a standard scaler, k of 5, a plot, and the cluster metrics. A small segmentation example, not a scale proof.
The same graph as the diagram below, on the Mall Customers tutorial table. The table page is Mall Customers.
Transcript
The question is which of these shoppers look alike, from age, annual income, and spending score. This is unsupervised. The groups describe the two hundred people in the file. They do not predict a later visit.
The Data Loader is the node that places a dataset on the canvas. It sits under Data Source. This run uses Mall Customers.
Two hundred shoppers, and three columns. Age is in years. Annual income is in thousands of dollars. The spending score runs from 1 to 100.
Income is in thousands and the spending score is on a 1 to 100 scale, so an unscaled distance lets income dominate. Normalization puts age, income, and spending on one scale: zero mean and unit variance. All three columns are scaled, because each one is part of the distance. Drop a node and it wires to the one before it.
K-Means looks for a chosen number of groups. It places a center for each group, assigns every shopper to the nearest center, then moves the centers and repeats. k of 5 is a starting split for this small table. It is not proof that five is the true number of kinds of shopper.
Clusters is set to 5. Initialization stays k-means++, which spreads the starting centers instead of planting them at random. Ten restarts keep the best of those starts. The seed on the bar is left blank, so this run uses 42, and the same file produces the same groups.
Two evaluation nodes close the chain. The plot draws the shoppers so the groups can be seen. The metrics node scores how separated those groups are. Silhouette runs from minus 1 to 1, and higher means a shopper is closer to the others in the same group than to the next group. Calinski-Harabasz rises when the groups are tight inside and far apart. Davies-Bouldin goes the other way: lower means the groups resemble each other less.
A long chain gets stacked into a column, one node on top of the next. These go back beside each other, in one row, so the path can be read across the canvas.
The chain is on screen. Data loader, the standard scale, K-Means, then the plot and the metrics.
Run. All 200 shoppers go through the chain. There is no hold-out to score against.
The finished nodes were stacked again. They go back beside each other before the scores are read.
The plot draws scaled age against scaled annual income. The color is the group K-Means assigned. Spending score is part of the distance, and it is not one of these axes, so a group that splits on spending can look mixed here. How clean the split is comes from the scores.
Silhouette is 0.4166. It is positive, so a shopper sits nearer the other people in the same group than the next group. It is also well short of 1, so the boundary is real but not a hard cut. Calinski-Harabasz is 125.1009. Higher is a stronger split. Davies-Bouldin is 0.8746. Lower is better. It is below 1, so the gap between the groups is wider than the spread inside them. k of 5 was a starting split, not a peak that was searched for. These scores describe all 200 shoppers.
Copilot adds the Metrics node
A Mall Customers graph is already on the canvas. Copilot adds a Metrics node and runs it. The table is Mall Customers.
Transcript
This is a tutorial. A pipeline is already on the canvas. It loads the Mall Customers sample, scales the columns, and clusters them with K-Means.
The point of this clip is to use Copilot. Ask it to add a Metrics node, and then run the pipeline.
The request is: Add a Metrics node and run.
Copilot adds the Metrics node next to K-Means, and the pipeline runs.
Here are the scores. Silhouette is 0.4166. Calinski-Harabasz is 125.1009. Davies-Bouldin is 0.8746. k is 5, and the seed is 42.
Pipeline Stages
Data Loader
Normalization
K-Means
4Cluster Plot
Metrics
Data Loader. Loads the Mall Customers dataset (200 samples, 3 features). Source: Mall customer segmentation tutorial. License: Tutorial table hosted on this site.
Normalization. Standard scaler on age, annual income, and spending score.
K-Means. k=5, k-means++, 10 restarts, seed 42. A starting split for 200 shoppers.
Cluster Plot. Scaled age against scaled annual income. Spending score is in the distance and is not an axis.
Metrics. Silhouette, Calinski-Harabasz, and Davies-Bouldin
Overview
This pipeline loads the Mall Customers tutorial table, scales age, annual income, and spending score with StandardScaler, then runs K-Means with k=5 and seed 42. The table has 200 shoppers. It is a tutorial example, not evidence that the pipeline scales.
Why This Pipeline Works
Income is in thousands of dollars and the spending score runs from 1 to 100, so an unscaled distance lets income dominate. StandardScaler puts the three columns on one scale before K-Means. k of 5 is a starting split for this small table, not a claim about a larger mall.
Expected Output
The published fit, computed on 2026-11-04 with scikit-learn 1.4.2, has 5 clusters. Silhouette is 0.416643, Calinski-Harabasz is 125.10094, and Davies-Bouldin is 0.874551. The voice says silhouette 0.4166, Calinski-Harabasz 125.1009, and Davies-Bouldin 0.8746. Silhouette is positive and well short of 1. Davies-Bouldin is below 1. k of 5 is a starting split, not a searched peak.
Evaluation Metrics
Silhouette Score
0.416643 on this fit (higher means a cleaner split)
Calinski-Harabasz Index
125.10094 (higher means denser, better separated groups)
Davies-Bouldin Index
0.874551 (lower means less overlap between groups)