AI Grounds

Open AI Grounds on a desktop

These interactive lessons need a larger screen. Please continue on a desktop or laptop computer.

Guided discovery

Linear Classification & Decision Boundaries

Move a weight. Trace the decision boundary.

Your dataset · Fixed actual labels

Teal circles = actual Class A; orange squares = actual Class B. Indigo line = the decision cutoff. Each ring shows a prediction: solid for Class A, dashed for Class B. Editing parameters never moves these observations.

-3-3-2-2-1-100112233A1A2A3A4B1B2B3B4x1x2

1x1 + 1x2 + 0 = 0.000000.

Contribution of x1 to the raw score. Use arrow keys on the slider. Press Enter or leave the number field to apply an exact edit.

Contribution of x2. Zero is allowed; it can produce a vertical boundary. Use arrow keys on the slider. Press Enter or leave the number field to apply an exact edit.

Constant added to every score. Use arrow keys on the slider. Press Enter or leave the number field to apply an exact edit.

Policy: choose Class A when sigmoid(score) ≥ cutoff. Changing it keeps scores fixed. Use arrow keys on the slider. Press Enter or leave the number field to apply an exact edit.

Selected point · z=w1x1+w2x2+Bias; sigmoid(z)=1/(1+exp(−z)). Actual label and decision are separate.
PointScoreProbabilityDecisionActual
A41.0000000.731059Class AClass A
All-point score table
Pointx1x2ActualScoreProbabilityDecision
A102A2.0000000.880797A
A211A2.0000000.880797A
A321A3.0000000.952574A
A410A1.0000000.731059A
B1-21B-1.0000000.268941B
B2-10B-1.0000000.268941B
B3-1-1B-2.0000000.119203B
B4-2-2B-4.0000000.017986B
Geometry, limits and source

Both feature axes have equal scales. The line is clipped only to the visible −3..3 square. With nonzero weights and 0<cutoff<1, it solves w1x1+w2x2+Bias=ln(cutoff/(1−cutoff)). Cutoff endpoints have no finite logit. Finite scores here produce probabilities strictly between zero and one. Zero weights give a constant scorer; a tie everywhere is different from a separating line. This workbench directly edits parameters; it does not optimize them or estimate calibration from data.

Deep Learning · Logistic regression and decision rules