Blog
Business data

Customer segments with k-means

Group similar customers from one spreadsheet, choose how many types, and treat each one differently.

Skari team3 min

You have a spreadsheet full of customers, but have you ever wondered what you could actually do with it?

"What kinds of customers do we have?"

The method that answers this is cluster analysis. Here is how to split customers into types from a single spreadsheet.

What cluster analysis is

Cluster analysis groups similar customers together. It doesn't start from a known answer; it finds similar groups inside the data, so you can discover "customer types we didn't know about".

How k-means works

  1. Place as many centres as the number of groups you want (k)
  2. Assign each customer to the nearest centre
  3. Recompute each centre from the customers assigned to it
  4. Repeat until nothing changes

What to prepare

  • Choose variables — ones that show behaviour, such as recency, frequency and monetary value (RFM)
  • Put them on one scale — standardise when units differ, like money and counts
  • Check outliers — so one or two extreme values don't drag the result

How many groups?

The usual guide for choosing k is the silhouette coefficient. The closer to 1, the better separated the clusters.

But just as important as the number is whether you can explain the groups. They are only useful if you can name each type and treat it differently.

Naming and using the types

Compare the variable means of each cluster and the character of each type shows.

  • Loyal big spenders → keep them with membership perks
  • Occasional visitors → coupons to bring them back more often
  • At risk of leaving → messages that win them back

In Skari

The Skari AI start screen lays out the tasks in research order, from finding prior research to writing the report. Pick "Data analysis" here, or just type what you want to do.

Seven tasks in research order — with Data analysis picked and a request typed
Seven tasks in research order — with Data analysis picked and a request typed

In Skari, upload your spreadsheet and say something like "Split our customers into types".

Split your customers into types

Upload a file to Skari AI and say it in one sentence

Open Skari AI

Choose the variables for clustering, and you see the silhouette coefficient for each number of clusters (k), with a verdict such as excellent, good, fair or poor for the solution you pick, which makes choosing k easier.

Silhouette across k — example result from the k-means report (150 iris flowers, 4 variables, k = 3)
Silhouette across k — example result from the k-means report (150 iris flowers, 4 variables, k = 3)
Validation metrics and verdicts for the chosen solution — same example
Validation metrics and verdicts for the chosen solution — same example

The result shows each cluster's character at a glance, with a chart.

Cluster profiles — how far each cluster mean sits from the overall mean (in SD units), same example
Cluster profiles — how far each cluster mean sits from the overall mean (in SD units), same example

Wrapping up

Cluster analysis stops you treating customers as one lump. Approach each type differently and the same budget goes further.

Want the theory behind it?The Academy's clustering guide covers k-means and how to choose between clustering methods →

Keep reading

Every feature free through Dec 31, 2026

Run the analyses from these posts on your own data