Linear regression is probably the simplest machine learning method. This app shows live how a multivariate linear regression can be used as both a regression model and a classification model — and where its limits lie.
The app visualises a multivariate linear regression in two modes. In regression mode, the continuous output of the model is shown as a colour gradient — from blue (low value) through white to red (high value). In classification mode, the output value is thresholded at 0.5, creating a decision boundary.
Since linear regression fundamentally places a hyperplane through the feature space, the decision boundary is always linear — regardless of the distribution of data points. This makes the method fast and interpretable, but also vulnerable to non-linearly separable data.
Use the switch at the top to toggle between regression mode (colour gradient) and classification mode (binary decision boundary). Observe in particular how the linear boundary always remains straight even with very skewed data distributions.
Data points can be moved, added (via the blue and red plus buttons) or removed by dragging them onto the bin icon. The model is recalculated instantly on every change.
Interested in AI visualisations for teaching?
The VisualApps are created as a teaching and transfer project at Reutlingen University and are used in corporate training and talks.
Get in touch