Guide-linked quiz · Medium Level
K-Nearest Neighbors Quiz
Covers neighbor voting, feature scaling, the cost of prediction, metric choice, and practical tradeoffs when storing training examples.
Question 1 of 8
How does KNN classify a new data point?
Preview every question8 questions
Answers and explanations appear as you take the quiz.
- How does KNN classify a new data point?
- By taking a majority vote of its K closest neighbors
- By training a neural network on it
- By computing a weighted regression line
- By assigning a random class
- Why is KNN often called a “lazy learner”?
- It never stores training data
- It stores training examples and can defer much model-specific work until prediction, though indexes may be built during fitting
- It always trains a deep neural network first
- It does no work during either fitting or prediction
- Why is feature scaling important for KNN?
- It makes training faster
- It reduces the number of neighbors needed
- So features with large ranges do not dominate the distance
- It changes K automatically
- What happens if you choose a very small K, like K=1?
- The model becomes very smooth
- The model ignores the data
- Predictions become impossible
- The model becomes sensitive to noise and may overfit
- In a brute-force KNN implementation, why can prediction be slow on a large dataset?
- It may compute distances from a query to many or all stored examples
- It must update all model weights for every query
- It reruns the entire training dataset through a neural network
- It cannot use an index or approximate search
- Which modern technology relies on the nearest-neighbor idea?
- Image compression with JPEG
- Vector search and retrieval-augmented generation
- Random number generation
- Spreadsheet formulas
- Why should a feature scaler be fit only on the training split before KNN evaluation?
- To make the distance metric ignore every feature
- To guarantee all classes have equal counts
- To avoid using information from validation or test examples when setting the scale
- To remove the need to choose K
- How can KNN make a prediction for a regression task?
- Choose the most common class label only
- Fit a new deep network for each query
- Ignore the stored examples and use a fixed intercept
- Aggregate the target values of the K nearest training examples, often by averaging
Keep testing yourself
More quizzes picked for your level.