GenerateRandomSearch

Outlier Dataset Generator

Testing an outlier rule needs data where you know which points are genuinely anomalous — otherwise you can only check that it flags something. Here the contaminated points are labelled, and the interquartile rule is run against them, reporting both numbers that matter: how many planted outliers it caught, and how many ordinary points it wrongly flagged. Neither is usually zero, which is the honest lesson about outlier rules.

What this generator does

Draws a normal sample around 50 and moves a chosen share of points far outside it, keeping their positions labelled. It then applies the interquartile rule — 1.5 times the interquartile range beyond each quartile — and scores it against the truth.

How to use this tool

  1. Choose how many rows and what share should be contaminated.
  2. Look at the fences the interquartile rule computes.
  3. Compare what it caught against what was planted.
  4. Note the false positives — ordinary points beyond the fences.

Understanding the controls

How many rows
Between 20 and 500 values drawn around a mean of 50.
Contamination (%)
What share of points are deliberately moved far from the bulk. Higher contamination shifts the quartiles themselves, which makes detection harder rather than easier.
Seed
Reproduces the same sample and the same contaminated positions.

Common use cases

  • Scoring an anomaly detection rule against known ground truth
  • Showing that the interquartile rule misses some and invents others
  • Test data for a data-cleaning pipeline
  • Teaching where box plot whiskers come from
  • Reproducing the same contaminated sample from a seed

How this generator works

The fences come from the quartiles of the contaminated data, not the clean data — which is the realistic case and the reason heavy contamination hides itself. The check confirms the flagged list follows exactly from the fences, and that the caught and false-positive counts add up to the flagged total.

Randomness and fairness

The sample and where the outliers land are random; the detection rule is deterministic. Seeded datasets reproduce and are therefore explicitly not cryptographically secure, and 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

  • One variable only — multivariate outliers can be perfectly ordinary in each dimension separately.
  • Only the interquartile rule is scored; z-scores and model-based methods behave differently.
  • Outliers are placed far out, so they are easier to find than borderline real ones.
  • The underlying distribution is normal, which flatters the rule.
  • Contaminated samples are not kept; seed one to score a rule twice on it.

Privacy and your data

The sample and the detection run entirely in your browser. Nothing is transmitted or retained.