Analytics
K-Means Clustering
Groups rows into k clusters of similar values across the numeric columns you pick, and writes each row's cluster number (1…k) in a new column.
When to use it
Use it to find natural segments — customers by spend and visits, stores by size and sales — when you have no labels to learn from.
In a pipeline
File InputK-Means ClusteringSummarize (Multi-Aggregate)
Settings
| Setting | Type | Required | Default or hint |
|---|---|---|---|
| Columns | select | Yes | Pick the numeric columns to compare |
| Number of clusters (k) | number | — | 3 |
| Scale columns first (z-scores) | checkbox | — | true |
| Seed | number | — | 1 |
| Max iterations | number | — | 100 |
| Cluster column name | text | — | Default: Cluster |
Example
Two customer segments
- Columns=Spend, Visits
- Number of clusters (k)=2
| Customer | Spend | Visits |
|---|---|---|
| Ann | 120 | 3 |
| Bob | 95 | 2 |
| Cara | 910 | 21 |
| Dev | 880 | 18 |
| Customer | Spend | Visits | Cluster |
|---|---|---|---|
| Ann | 120 | 3 | 2 |
| Bob | 95 | 2 | 2 |
| Cara | 910 | 21 | 1 |
| Dev | 880 | 18 | 1 |
Worth knowing
- Columns are scaled to z-scores first by default, so Spend in thousands does not drown out Visits in tens; untick it when the columns share a unit.
- The same Seed always gives the same clusters (k-means++ start). Cluster numbers are labels, not ranks.
- Rows with a blank or non-numeric value in a picked column get no cluster; the note counts them.
- Summarize by Cluster afterwards to describe each segment. Limited to the server's row ceiling (1,000,000 by default).