Learn by doing · Binary classification

Same data. Different boundaries.

Explore how four models learn to separate two classes. Change the shape of the data, add noise, and compare their decision regions.

Questions? Ask the assistant ↓
Model parameters

● Circles · Class 0■ Squares · Class 1Filled: training · Hollow: test

The background shows the predicted class, with a line where that class changes. Every plot uses the same data and axes. Scores show classification accuracy.

What to look for

A straight line can separate two clusters, but usually cannot describe moons or circles. Local methods and trees can learn more complex shapes. A more detailed boundary does not always generalize better: compare training and test accuracy as you increase noise or depth.

30% of each class is held out for testing; models train only on the remaining 70%. The same seed reproduces the data and split. This is an educational demonstration with synthetic data, one split, and boundaries approximated on a grid. Logistic regression uses 900 gradient-descent steps; the tree uses Gini splits and at least two observations per leaf.