Interactive perceptron
Add points for each class. The boundary retrains after every point.
Click anywhere inside the graph to add the selected class.
How it learns.
weights ← [0, 0]
bias ← 0
repeat up to 100 times:
mistakes ← 0
for each point:
score ← w₁x + w₂y + bias
guess ← +1 if score ≥ 0, otherwise −1
if the guess is wrong:
weights ← weights + label × [x, y]
bias ← bias + label
mistakes ← mistakes + 1
stop when mistakes = 0