GenerateRandomSearch

Imbalanced Dataset Generator

A model that flags nothing as fraud is 99% accurate on data with 1% fraud. That single fact is behind most misreported classification results, and it is far more convincing as a number you generated than as a warning you read. This builds a two-class dataset at whatever imbalance you choose and states the majority-class baseline outright, because that is the score any real model has to beat.

What this generator does

Builds a single feature that separates the classes by an adjustable amount, then labels rows to hit the ratio you asked for. The majority-class baseline is computed and shown prominently, since a model that cannot beat it has learned nothing at all.

How to use this tool

  1. Set how many rows and how rare the minority class should be.
  2. Adjust the separation to make the classes easier or harder to tell apart.
  3. Generate, and note the majority baseline before doing anything else.
  4. Copy the CSV and check your model beats that number.

Understanding the controls

Minority class share
Anything below 50%. At 1% the majority baseline is 99%, which is the case worth seeing.
Class separation
How distinguishable the classes are on the feature. At zero they are indistinguishable and no model can do better than the baseline, which is itself a useful test.
How many rows
Between 20 and 1,000. At extreme ratios a small dataset may hold only a handful of positives, which is realistic.
Seed
Reproduces the identical dataset so two approaches can be compared fairly.

Common use cases

  • Testing a classifier against a realistic imbalance rather than a tidy 50/50
  • Demonstrating why accuracy is a misleading headline metric
  • Producing data to compare precision, recall and F1 against accuracy
  • Checking whether resampling or class weights actually help
  • Teaching the accuracy trap with a number rather than a caution

How this generator works

Positives are drawn around a separated mean and negatives around zero, with the counts fixed to your requested ratio rather than sampled — so the imbalance is exact. The baseline is the larger class divided by the total.

Randomness and fairness

The feature values are random; the class ratio is not, being fixed by construction. 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

  • A single feature, which makes the problem far easier than a real one.
  • It generates the imbalance but does not address it — resampling and class weighting are yours to apply.
  • Real rare-class problems usually also have label noise, which is not modelled here.
  • Nothing persists between visits, so seed anything you want to compare against later.

Privacy and your data

The dataset is built in your browser and stays there. No settings, seeds or rows are uploaded or stored between visits.