← All interactives
Eulerly · Try it yourself

Hyperplane classifier

One equation, w · x + b = 0, draws a line and splits the plane in two. The vector w stands at a right angle to the line and points into the + side. Plug any point in: the sign of its score w · x + b says which side it is on, and dividing by ‖w‖ turns the score into a real distance.

Grid:

Same line, bigger numbers

‖w‖
Origin's distance |b| / ‖w‖
how far the line is from (0, 0); b alone is the score of the origin
+ side · − side · on the line

Selected points

Click a point to select or deselect it. Each selected point shows its score and its signed distance (negative on the − side). With more than four selected, only P and N keep their labels on the plane; the table lists them all.

What to try