← All nodes
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

Settings

SettingTypeRequiredDefault or hint
ColumnsselectYesPick the numeric columns to compare
Number of clusters (k)number—3
Scale columns first (z-scores)checkbox—true
Seednumber—1
Max iterationsnumber—100
Cluster column nametext—Default: Cluster

Example

Two customer segments

  • Columns=Spend, Visits
  • Number of clusters (k)=2
Customers
CustomerSpendVisits
Ann1203
Bob952
Cara91021
Dev88018
A cluster for each
CustomerSpendVisitsCluster
Ann12032
Bob9522
Cara910211
Dev880181

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).

Others in Analytics