k-Nearest Neighbors

35 min
Block 9 — Nonparametric instance-based models
Objective
understand k-nearest neighbors as pure instance-based learning; master distance metrics and when each is appropriate; measure the decisive role of feature scaling; recognize the bias-variance tradeoff controlled by k; understand the curse of dimensionality and its practical remedy; account for computational costs at training and inference; recognize when kNN is the correct model and when it is a symptom of poor feature engineering.
Estimated duration
75 minutes
Prerequisites
chapters 006 (features and target), 007 (labels and classes), 008 (algorithm vs model), 023 (feature scaling), 026 (train-validation-test split), 029 (fit-predict-predict_proba)
Associated quizzes
040.1-quiz-fit-and-lazy-learning.md to 040.6-quiz-when-to-use-knn.md

Preview — the rest of the lesson is for enrolled readers.

Already enrolled with a code?

Your access is tied to your account, not to this link. Sign in with the same email you used in class: your course is waiting, no need to enter the code again.

Sign inNo account yet? Create one
This lesson is part of the “Classification Algorithms” module

The first modules of the course are open to everyone. For the rest you have three options: buy this course once and for all, subscribe, or enter the code handed out in class.

Are you a student on this course?

The code is tied to your account: sign in or create an account and it will be applied automatically when you come back.

No account yet? Create one