GenerateRandomSearch

Logistic Regression Dataset Generator

Labelled data where the boundary is known, so you can check whether a classifier actually recovered it. The number that matters most is not the accuracy — it is the majority-class baseline, because a model that always guesses the commoner class already scores that. If your classifier gets 85% and the baseline is 84%, it has learned almost nothing, and this page puts both figures side by side for exactly that reason.

What this generator does

Draws points, labels them by which side of a hidden line they fall on, and pushes some across it with noise. It reports how accurately the true boundary classifies its own data, and what always guessing the commoner class would score.

How to use this tool

  1. Choose how many rows and how much noise to add.
  2. Generate, and note the baseline accuracy before anything else.
  3. Copy the CSV and fit a model to it.
  4. Compare your model's accuracy against the true boundary's, not against fifty percent.

Understanding the controls

How many rows
Between 20 and 500 labelled points. More rows make the class balance steadier.
Noise
How far points are pushed across the boundary. Zero makes the classes perfectly separable, which real data never is.
Seed
Reproduces the same dataset while the generator is unchanged, which is what makes a training run repeatable.

Worked examples

20 rows, noise 1, seeded "demo"
Labels come from the line 2x1 - 3x2 - 4 = 0. This run happened to land at 55% positive, and the true boundary classifies 100% of its own data correctly — while a model that always guessed the commoner class would score only 55%, the number any real classifier has to beat.

Common use cases

  • Test data for a classifier with a known correct answer
  • Showing why accuracy alone is a misleading measure
  • Teaching decision boundaries with data you can plot
  • Checking that a training pipeline recovers a planted relationship
  • Reproducing the same dataset from a seed

How this generator works

Labels come from the sign of a linear combination plus normal noise, so the structure is genuinely linear and genuinely imperfect. The check counts the boundary's accuracy and both class shares again off the finished rows, and confirms that zero noise gives perfect separation. The boundary usually beats the majority baseline, and is not required to: with heavy noise on few rows the labels are mostly noise and the line that made them can score under it (50 rows at noise 8 gave 62% against 64%). When that happens the page says so under the data, because there is then little for a model to find.

Randomness and fairness

The points and the noise are random; the boundary is fixed per dataset and reported. Seeded datasets reproduce exactly and are therefore explicitly not cryptographically secure. Unseeded, the browser's cryptographically secure generator draws them.

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

Limitations and good to know

  • Two features only, so the data can be plotted — real problems have many more.
  • The boundary is linear, which is the easy case; curved boundaries need different models entirely.
  • Noise is normal and identical everywhere, rather than varying across the space.
  • No train and test split is provided; that is left to you.
  • Datasets are not stored between visits.

Privacy and your data

Every row is generated in your browser. Neither the dataset nor your seed is transmitted or kept; what is measured is that a dataset was made and how many rows it has.

Frequently asked questions

Why compare my model's accuracy to the majority baseline instead of 50%?
Because the two classes are rarely split exactly 50/50, even by chance in a single generated sample — this run landed at 55/45. A model scoring 55% has matched a strategy that ignores the data entirely (always guess the commoner label); the baseline this page reports is the real floor any classifier needs to clear before it can be said to have learned the boundary.
Why doesn't the true boundary classify every point correctly?
Because noise pushes some points across the line after the labels are assigned, so even the boundary that generated the data doesn't perfectly separate the finished dataset — that's what makes it realistic rather than a toy where a model can trivially get 100%. Set noise to 0 for perfectly separable data, which real classification problems essentially never give you.