K-means Clustering
← SkillSafe

Find groups in a CSV with k-means clustering

Drop a spreadsheet export. Its number columns are scaled and grouped, and the best number of groups is picked for you.

or drop one here · .csv .tsv .txt
Nothing handy? Try one:

How it works

  1. Drop a file or paste cells. A CSV or TSV export with one row per thing — a customer, an order, a reading — and a header row on top.
  2. It picks the number columns. ID-like columns (customer_id, a count that goes up by one) and columns where every value is the same are left out. Text columns are not used for grouping but are shown per group.
  3. It scales, then groups. Each column becomes standard scores so no unit dominates, then k-means++ groups the rows. It tries 2 to 8 groups and keeps the number with the best silhouette score.
  4. It shows and describes the groups. A chart of every row coloured by group, and for each group the columns where its average is furthest from the overall average.
  5. You take the CSV back. Your file with a group column added, ready for a pivot table, a filter or a mail merge.

Questions

Is my file uploaded?
No. The file is read and grouped inside your browser tab. Only the optional AI step sends anything: one summary per group (its size, its column averages next to the overall averages, and any category value it has much more of), never your rows, and only when you press its button.
How does it pick the number of groups?
It groups the rows into 2, 3 and so on up to 8 groups and scores each with the silhouette score, which compares how close every row is to its own group with how close it is to the next one. The highest score wins. The chart under Why this many groups shows every score, and you can choose any number from 2 to 10 instead.
Which columns does it use?
Every column that holds numbers, except columns that look like IDs (a name such as customer_id, or a count that goes up by one each row) and columns where every value is the same. Text and category columns are not used for grouping, but each group shows which category values it has much more of. You can tick columns in and out under More options.
Why are the columns scaled?
K-means measures plain distance, so a column in thousands (income) would drown out a column in single digits (visits). By default each column is turned into standard scores first, so every column counts the same. You can switch to a 0 to 1 range or to the raw values under More options.
What happens to rows with blanks?
By default a row with a blank in a chosen column is left out of the grouping and gets an empty group in the download; the page says how many. Under More options you can fill blanks with the column average instead.
Will I get the same groups every time?
Yes. The starting points come from a fixed seed and the best of several starts is kept, so the same file and settings always give the same groups, numbered from the largest group down.
What does the 2-D map show?
With more than two columns, the chart uses principal component analysis to flatten the rows onto the two directions where they spread the most. Groups that overlap on the map may still be apart in the full data; the fit score is measured on all the columns.
How big a file can it take?
Up to 50,000 rows are grouped; anything after that is left out and the page says so. Large files take a few seconds.