Select a point · Drag the round handle to shift the boundary · Drag the square handle to rotate
Training mistakes per epoch
Complete an epoch to see its mistake count.
Perceptron
The perceptron is a linear classifier that learns a separating line by adjusting weights after each mistake. It converges on linearly separable data, but will keep oscillating on non-separable datasets.
How to Use
- Press Play to train step-by-step
- Adjust learning rate to change update size
- Switch datasets to see convergence vs. failure
- Click a point to inspect its live prediction and update math
- Drag the boundary to shift it; Shift-drag to rotate it
- Step by Mistake pauses before an update; Sample shows its result
- Controls lets you add/relabel data and edit weights
Training Loop
- Compute activation
a = w·x + b - Predict
ŷ = sign(a) - If wrong, update
w ← w + η(y - ŷ)x - Update bias
b ← b + η(y - ŷ)and redraw
On non-separable data, mistakes never reach zero.
Current Step
- Activation: compute
w·x + b - Prediction: classify the sample
- Update: adjust weights if needed
- Redraw: update boundary and metrics
Training settings and Reset keep these data points and the starting weights. Editing the classifier starts a new run from your weights.
Geometry reference
The boundary is the line where w·x + b = 0. The weight vector w
is normal to the line. The dashed score contours are w·x + b = ±1, each 1 / ||w|| from the boundary. These are not a learned maximum margin.
| Epoch | 0 |
| Phase Step | 0 |
| Mistakes | 0 |
| Accuracy | 0% |
| Weights | [-, -] |
| Bias | 0.00 |
| Status | Ready |