AI / ML · Live Demo

Perceptron Classifier

The simplest possible learning machine, ported from my Python project. One perceptron, three weights, and a hundred points. Each point is labeled by whether it falls above or below a hidden line, and the perceptron nudges its weights on every point until its guess matches the truth.

  • The rule. It sums weighted inputs plus a bias and fires plus one or minus one.
  • Learning. Each step it shifts weights toward any point it got wrong.
  • Watch it. Green points are classified right, red are wrong, and the purple line is the current boundary.
JavaScriptCanvasMachine LearningPerceptron
View source on GitHub
epoch 00% correct

Green line is the true boundary, purple is the perceptron's guess. Watch it converge.