Skip to content
All apps

Linear separating plane (3D)

About this app

A linear classifier in space: two point classes, one separating plane with normal vector w. Rotate/shift the plane with sliders or auto-separate via the perceptron — separable, overlapping and XOR data reveal the strength and the limit of the linear model.

What a linear classifier does

A linear classifier separates two classes with a hyperplane, which in three dimensions is a plane. A point x is assigned to class A if n·x > b, otherwise to class B. The normal vector n (the weight w) is perpendicular to the plane and points towards the A side, while b shifts the plane. If the classes are linearly separable, the perceptron learning rule finds a separating plane after finitely many corrections. With overlapping classes or an XOR pattern, no single plane is error-free.

What you see

Two point clouds float in a rotatable 3D scene with the separating plane between them and the normal vector drawn as an arrow. Misclassified points get a ring. A statistics panel shows the share of correctly and wrongly classified points and the current plane equation n·x = b. Three datasets are available: “separable”, “overlapping” and “XOR”.

Things to try

Rotate the plane with azimuth and elevation and shift it with b until as few rings as possible remain. Then press “auto-separate (perceptron)”: on “separable” it succeeds without errors, on “overlapping” some errors remain. “XOR” shows the limit of the linear model. Clicking a point flips its class, so you can turn separable data into non-separable data on purpose.

Frequently asked questions

What is a separating hyperplane in machine learning?
A separating hyperplane divides the feature space into two halves, one per class. It is described by a normal vector w and an offset b: points with w·x > b lie on one side and the rest on the other. In two dimensions it is a line, in three a plane.
Why can’t a linear classifier solve XOR?
In the XOR pattern, points of the same class sit in diagonally opposite corners. Any plane that separates one corner from its neighbour also cuts off a corner of the same class. Only non-linear models, for example with a hidden layer or a feature transformation, can separate XOR.
How does the perceptron learning rule work?
The perceptron goes through the points and only adjusts the plane on mistakes: for a misclassified point x with label y = ±1, w is moved by y·x and b is adjusted accordingly. If the data are linearly separable, the procedure stops after finitely many corrections with a separating plane.
What can I do in this app?
You rotate and shift the plane by hand or let the perceptron separate the classes, flip individual points by clicking them, and compare the “separable”, “overlapping” and “XOR” datasets. Rings mark errors and the statistics panel shows the accuracy.

Subject: Machine Learning

More from Machine Learning

A VisuApp by heyprof: interactive, free in your browser, no sign-up. What is a VisuApp? · All apps