Class A Class B
⚠ Couldn't load the 3D engineThree.js failed to load from the CDN. Check your connection and reload.

Supervised Learning: k-NN Decision Surface Sandbox

This simulation illustrates the principles of supervised learning by allowing users to train an AI model on labeled data. Click to place labeled examples of two classes into a 2D feature space and watch a k-nearest-neighbors classifier rebuild its decision surface in real time — the raised, colored landscape above the points shows exactly what the model predicts everywhere in the space, and how confident it is. A live leave-one-out cross-validation score demonstrates how algorithms learn from examples to make predictions, and how the number of neighbors k trades off a jagged, overfit boundary against a smooth, generalizing one.