Vismo · Create · Explore · Topics · Guides · Pricing

How K Changes a KNN Prediction

A white query point at the origin is surrounded by cyan and orange training points. An expanding circle reveals distances in increasing order, showing how the set of nearest neighbors changes as K grows from 3 to 5, flipping the majority vote from cyan to orange. The animation only updates the predicted outline, never the true label, and links the example to three design choices: distance metric, neighborhood size, and voting rule, while contrasting plain voting with distance weighting. Useful for first-year AI students learning what KNN actually computes.

Narrated · 16:9 · Preview before teaching · automatic layout checks do not establish subject accuracy

The prompt that made it

# Changing the neighborhood changes the KNN prediction A white query point sits at (0,0). Cyan training points lie at (1,0) and (0,1.2); orange points lie at (-1.4,0), (0,-1.6), and (1.8,0). Expand a circle from the query, revealing Euclidean distances 1, 1.2, 1.4, 1.6, and 1.8 in order. With K = 3, two cyan votes defeat one orange vote. With K = 5, three orange votes defeat two cyan votes. Change only the predicted outline of the query, not its unknown true label. Connect this example to the three design choices: distance metric, neighborhood size, and voting rule. Briefly contrast ordinary voting with distance weighting and explain why feature scaling must be fitted on training data. Use black backgrounds, fixed coordinates, and English narration synchronized to the expanding neighborhood. Useful for understanding what KNN actually computes. Audience: 一年级人工智能专业学生

Make your own version

Make the next one in this series