KNN Fit and Predict

easy

Task

Train a K-Nearest Neighbors classifier on the iris dataset and make predictions on the test set.

Why It Matters

The fit/predict pattern is the core sklearn API. KNN is intuitive - it classifies based on the majority vote of k nearest neighbors. It's often used as a baseline and works well for small datasets with clear cluster separation.

Instructions

  1. Examine the setup code and data
  2. Modify the code to solve the puzzle
  3. Click Run or press Ctrl+Enter to execute

Documentation

Command Palette

Search for a command to run...