Machine learning · interactive lab

Decision Boundary

A classifier built from one rule: ask the nearest examples. Inspect its votes, change the neighborhood, and add a point to reshape the boundary.

Inspect the neighborhood

Click the plot or use its arrow keys to move the crosshair. Lines connect the query to its voting neighbors.

x →y ↑

● Cyan = class A · ■ Magenta = class B. Stronger shading means more neighbors agree; it is not a calibrated probability.

The vote

Class A

2 votes for A · 1 votes for B

Query: (0.00, 0.00)

Change the evidence

Place the crosshair, choose a class, then add an example. Try planting class B inside a cyan region.

40 / 100 examples

Does it generalize?

100.0%

Leave-one-out accuracy: each example is classified using only the other points. This avoids the perfect training score k = 1 gets by looking up itself. It describes these synthetic examples, not performance on unseen real-world data.

Euclidean distance on equally scaled axes. Fixed synthetic datasets; no model downloads or training service.