See how algorithms learn to separate data into categories
Classification is a type of machine learning where an algorithm learns to assign labels to data points. Given examples of different categories (like "spam" vs "not spam"), the algorithm finds patterns to classify new, unseen data.
In this demo, you'll create data points of two classes and watch different algorithms try to draw decision boundaries between them.
KNN classifies a point based on the majority vote of its K nearest neighbors. It doesn't learn a boundary—it memorizes all training data and looks up neighbors at prediction time.
Try it: Adjust K to see how it affects the decision boundary. Low K = complex boundary, High K = smoother boundary.
The line (or curve) that separates different classes. Points on one side get labeled Class A, points on the other side get Class B.
When a model is too complex and fits the training data perfectly but fails on new data. Low K in KNN can cause overfitting.
When a model is too simple to capture the pattern. A linear classifier underfits if the true boundary is curved.
Simple models have high bias (assumptions), complex models have high variance (sensitive to data). Finding balance is key.