Perceptron demo

Your browser does not support the <canvas> element.

Number of points:
Real weights:
w1: | w2: | b:
Perceptron weights:
w1: | w2: | b:
Accuracy: %
Error:

This is a JavaScript implementation of the simple Perceptron algorithm.
A perceptron is a binary classifier that works through a linear operation on its input. The algorithm updates the weights used in the operation so that the classification provide better results.
In this example, our Perceptron has to classify 2-D points on a graph. The class of a given point corresponds to which side of a line (represented on the graph as a bold line) the point is on; visually, this is shown as the color of the points. As the algorithm goes, the Perceptron (represented by the thinner line) will update itself and progressively match the reference class; which is shown on the graph as the thinner line getting closer to the bolder line.