GenerateRandomSearch

Clustered Dataset Generator

Clustering algorithms always return clusters. That is the problem: run k-means asking for four groups on data that has two, and you get four confident groups. Testing against data whose true grouping you know is the only way to tell recovery from invention, so every point here carries the group it was actually drawn from.

What this generator does

Places cluster centres evenly around a circle so they are always well separated and reproducible, then draws points around them with Gaussian scatter. Group sizes are kept within one of each other, and every point records the centre it came from.

How to use this tool

  1. Choose how many clusters and how many points.
  2. Set the spread — above about 20 the groups genuinely overlap.
  3. Generate and copy the CSV, which includes the true cluster for each point.
  4. Compare what your algorithm recovered against the labels.

Understanding the controls

How many clusters
Between 2 and 8, evenly sized. Asking your algorithm for a different number than this is the useful experiment.
Spread
How far points scatter from their centre. Small values give obviously separate blobs; above about 20 the groups genuinely overlap and the tool says so.
How many points
Divided as evenly as possible between the clusters.
Seed
Reproduces the same point set for as long as the generator is unchanged, which makes two algorithms comparable on the same data.

Worked examples

3 clusters, spread 6, seeded "demo"
Centres land at (85, 50), (32.5, 80.31) and (32.5, 19.69) — evenly spaced on a circle. A point from cluster 0 might scatter to (87.35, 36.94); its true cluster label of 0 travels with it in the CSV regardless of where a clustering algorithm later assigns it.

Common use cases

  • Testing a clustering implementation against known groups
  • Showing that an algorithm returns clusters whether or not they exist
  • Producing labelled 2D data for a scatter-plot component
  • Teaching why cluster validity measures are needed
  • Checking behaviour as groups move from separated to overlapping

How this generator works

Centres sit at equal angles on a circle of fixed radius, which guarantees separation without needing rejection sampling. Points are assigned to clusters round-robin so the groups stay balanced, then displaced by a Gaussian draw scaled by the spread.

Randomness and fairness

The scatter around each centre is random; the centres themselves are not — they are fixed by the cluster count. Seeded runs are reproducible and therefore explicitly not cryptographically secure; unseeded ones use the browser's cryptographically secure generator.

For how randomness is produced across the whole site, see how Generate Random works.

Limitations and good to know

  • Clusters are spherical and equally sized. Real clusters are often elongated, nested or wildly unequal, and those are the cases that break algorithms.
  • Two dimensions only, so it cannot demonstrate the curse of dimensionality.
  • Centres are always evenly spaced, which is friendlier than most real data.
  • Nothing is retained between visits; seed a dataset you want to reuse.

Privacy and your data

Points are generated locally in your browser. No seed or generated coordinate leaves the page or persists after it closes; of the settings, only the number of rows is measured, along with the fact that a dataset was made.

Frequently asked questions

Why place the centres evenly on a circle instead of scattering them randomly?
Random centre placement risks two centres landing close together by chance, which would make the clusters genuinely ambiguous for reasons that have nothing to do with the spread setting you chose. Fixed, evenly spaced centres guarantee separation and make spread the only variable controlling how much the clusters overlap.
How do I tell if my clustering algorithm actually found the right groups?
Compare the cluster label your algorithm assigns each point against the true cluster column in the generated CSV — a real evaluation, not a visual guess. Remember that a clustering algorithm will confidently return however many groups you ask it for whether or not that many genuinely exist in the data, so testing with the wrong requested cluster count is itself a useful experiment.