Epoch 0

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

  1. Compute activation a = w·x + b
  2. Predict ŷ = sign(a)
  3. If wrong, update w ← w + η(y - ŷ)x
  4. Update bias b ← b + η(y - ŷ) and redraw

On non-separable data, mistakes never reach zero.

Current Step

  1. Activation: compute w·x + b
  2. Prediction: classify the sample
  3. Update: adjust weights if needed
  4. 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.


0.005

  1. wi′=wi+η(y−y^)xi
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.

Epoch0
Phase Step0
Mistakes0
Accuracy0%
Weights[-, -]
Bias0.00
StatusReady
Sample: -
Activation: -
Prediction: -
Target: -