Everyone's AI
Machine learningPlayground

Playground

Hands-on AI lab

Deep Learning

  • NN Classifier
  • Loss Landscape Lab

Machine Learning

  • KNN Neighbor Classifier

Reinforcement Learning

  • RL Agent

Computer Vision

  • Conv Vision

Transformer

  • Attention Playground
NN ClassifierLoss Landscape LabKNN Neighbor ClassifierRL AgentConv VisionAttention Playground
Loading...

Playground

KNN Neighbor Classifier

Classify with a majority vote from the K nearest neighbors—no training step! Compare classical ML on the same K-datasets as the neural network classifier.

Control help

Click the canvas to move the query (purple ring); dashed lines connect the K nearest neighbors.

  • Neighbors K: How many nearest training points to use. Small K = jagged; large K = smoother.
  • Distance: How to measure distance between points—same L1/L2 ideas as in ml03.

Data

Which K-culture dataset?

Related lessons
Data and Features: The Start of Machine LearningK-Nearest Neighbors (KNN): Birds of a Feather

Classification

Background = KNN decision region · dashed = neighbor links · click = query

Click the canvas to move the query and inspect neighbors

Test accuracy

0.8167

Query prediction

Negative (−1)

K-vote breakdown

+1 / −4

  • #1 · d=0.21
  • #2 · d=0.33
  • #3 · d=0.51
  • #4 · d=0.67
  • #5 · d=0.68

Related lessons

  • K-Nearest Neighbors (KNN): Birds of a Feather
  • Classification Metrics: The Model's Detailed Report Card
  • Supervised, Unsupervised, and Self-Supervised Learning