K-Means on the 7,043-row IBM Telco sample. Customer id, gender, total charges, and churn stay out. Tenure and monthly charges are standardised. k of 2 is the silhouette peak from 2 through 8.
The same graph as the diagram below, on the IBM Telco Customer Churn sample. The table page is Telco Customer Churn.
Transcript
The question is which of these telecom customers look alike. This is unsupervised. The groups describe the people in the file. They do not predict who left.
Zoom and fit keep a long chain on screen.
The Data Loader is the node that places a dataset on the canvas. It sits under Data Source. This run uses Telco Customer Churn, the same IBM table as the churn classifier.
Open it from the sample library. Every row stays in the fit. There is no train and test split, because a cluster is a description of this file, not a forecast.
Seven thousand and forty-three customers, and twenty-one columns. Tenure, the service flags, and the account columns are all in this table. The grouping has to be told which of those should count as a difference between customers.
Drop Data takes columns out of the distance. Drop a node and it wires to the one before it.
Customer id is an identifier. Kept in, it would make every customer look unique. Gender stays out of this first grouping. Total charges is accumulated spend. Left beside tenure and the monthly rate, that history would pull the groups toward customers with large bills. Churn stays out because it is the label the other pipeline predicts. The groups can be compared on it afterwards. It is not a feature of this fit.
K-Means uses Euclidean distance, so a column with a wide range would dominate a column with a narrow one. Tenure is in months and monthly charges are in dollars. Normalization rescales only those two. The method is standard: zero mean and unit variance. Senior citizen is already 0 or 1, and the service columns become 0 or 1 in the next node. Scaling those would give a rare category too much weight, so they stay as they are.
The service and account columns are categories, not numbers. K-Means cannot measure a distance between the words yes and no. Encoding turns each option into its own 0 or 1 column. The method is one-hot. An ordinal code would have ranked those options, and that ranking would be an invention.
K-Means looks for a chosen number of groups. It places a center for each group, assigns every customer to the nearest center, then moves the centers and repeats. A check of k from 2 through 8, with this same preparation and seed 42, put the highest silhouette at 2. Calinski-Harabasz was highest there as well, and Davies-Bouldin was lowest. The three measures agree, so 2 is the candidate. That peak is the best of the values that were tried. It is not proof that two is the true number of segments.
Clusters is set to 2. 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 42, so the same file produces the same groups.
Two evaluation nodes close the chain. The plot draws the customers 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 customer 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.
The chain is on screen. Data loader, the columns that were dropped, the two scaled columns, one-hot encoding, K-Means, then the plot and the metrics.
Run. All 7,043 customers go through the chain. There is no hold-out to score against.
The plot is a two-component view of all 7,043 customers. The color is the group K-Means assigned, cluster 0 or cluster 1. These two axes are a view of the customers, not tenure against monthly charges. How clean the split is comes from the scores.
Silhouette is 0.2784. It is positive, so a customer sits nearer the other people in the same group than the other group. It is also well short of 1, so the boundary between the groups is soft. Calinski-Harabasz is 2372.0745. Higher is a stronger split, and this was the highest of the k values that were checked, which is why 2 was kept. Davies-Bouldin is 1.2649. Lower is better, and this was the lowest of that same check. It is still above 1, so the groups are wide compared with the gap between them. Read together, the file divides most cleanly into two broad groups, not into a set of tight segments. These scores describe all 7,043 customers. Churn was not a feature.
Pipeline Stages
Data Loader
Drop Data
Normalization
Encoding
K-Means
Plot
Metrics
Data Loader. Loads the Telco Customer Churn dataset (7043 samples, 20 features). Source: IBM sample data, telco-customer-churn-on-icp4d. License: Apache 2.0.
Drop Data. Removes customerID, gender, TotalCharges, and Churn.
Normalization. Standard scaler on tenure and MonthlyCharges only. The 0 and 1 columns stay as they are.
Encoding. One-hot. Service and account options are not ranked.
K-Means. k=2, k-means++, 10 restarts, seed 42. The silhouette peak for k from 2 through 8.
Plot. Each point is a customer. Color is the group.
This pipeline loads the same IBM Telco Customer Churn sample, 7,043 customers, and asks which customers look alike. Drop Data removes customerID, gender, TotalCharges, and Churn. Normalization standardises tenure and MonthlyCharges only. One-hot encoding turns the service and account columns into 0 and 1 indicators. K-Means uses k=2, k-means++, 10 restarts, and seed 42. There is no train and test split. The groups describe this file.
Why This Pipeline Works
Customer id would make every row unique. Gender stays out of this first grouping. Total charges is accumulated spend, so leaving it out keeps that history from sitting beside tenure and the monthly rate. Churn is the label the other pipeline predicts, so it is not a feature of the fit. The groups can be compared on it afterwards. K-Means uses Euclidean distance, so only the two wide-range columns are standardised. Senior citizen and the one-hot columns stay at 0 and 1. A check of k from 2 through 8, with this preparation and seed 42, put the highest silhouette at 2. Calinski-Harabasz was highest there as well, and Davies-Bouldin was lowest. That peak is the candidate this run uses. It is not proof that two is the true number of segments. Silhouette and Davies-Bouldin are not monotone across the rest of the check. The best value of each measure is still 2.
Expected Output
The published fit, computed on 2026-11-05 with scikit-learn 1.4.2, has 2 clusters on 7,043 customers. Silhouette is 0.2784. Calinski-Harabasz is 2372.0745. Davies-Bouldin is 1.2649. One group holds 1,526 customers, and 7.40 percent of them left. The other holds 5,517 customers, and 31.83 percent of them left. Those churn rates were counted after the fit. The voice says the same three scores.
Groups
Churn rate inside each group, counted after the fit. Churn was not a feature.
Group
Customers
Churn rate
0
1,526
0.0740 (7.40 percent)
1
5,517
0.3183 (31.83 percent)
k from 2 through 8
Same preparation and seed 42. Higher is preferred for silhouette and Calinski-Harabasz. Lower is preferred for Davies-Bouldin. The best value of each is k=2. Silhouette and Davies-Bouldin are not monotone after that.
k
Silhouette
Calinski-Harabasz
Davies-Bouldin
2 candidate
0.2784
2372.0745
1.2649
3
0.2364
2134.3050
1.7405
4
0.2055
1756.7069
1.8857
5
0.1897
1488.0142
2.1130
6
0.1523
1310.7782
2.0961
7
0.1292
1168.8318
2.2092
8
0.1338
1079.1258
2.2419
Evaluation Metrics
Silhouette
0.2784. Positive, and well short of 1, so the split is real and the boundary is soft
Calinski-Harabasz
2372.0745. Highest for k from 2 through 8
Davies-Bouldin
1.2649. Lowest for that same check, and still above 1
Groups
1,526 customers at a 7.40 percent churn rate, and 5,517 at 31.83 percent