01Chapter 1: Learning by remembering: instance-based methodsThis chapter assumes you know the basics of supervised learning: features, labels, and the split between training and test sets. You should be able to read short Python and NumPy code. You should also know that Euclidean distance is the straight-line distance between two points represented as vector3 min read
02Chapter 2: Measuring similarity with distanceThis chapter assumes you know what feature vectors are and can read basic NumPy. You should also know that k-NN predicts from the training points closest to a query. Here you will learn how "closest" is defined.3 min read
03Chapter 3: Classifying with the k nearest neighboursThis chapter assumes you know what features, labels and a train/test split are, and that you can compute Euclidean distance between two vectors. It also assumes basic Python and NumPy. Here you will turn distance into a working classifier.3 min read
04Chapter 4: How k shapes the decision boundaryThis chapter assumes you can run scikit-learn code and know how k-NN classifies by majority vote. It also assumes you know what a training and a test set are. Here you will see how the value of k changes the shape of the boundary between classes.3 min read
05Chapter 5: Choosing k: bias versus varianceThis chapter assumes you know how k-NN classifies by majority vote, what a decision boundary is, and how to split data into training and validation sets. It uses scikit-learn and NumPy.3 min read
06Chapter 6: Why feature scaling mattersThis chapter assumes you know how k-NN classifies with Euclidean distance, and that you can use scikit-learn estimators and train_test_split.3 min read
07Chapter 7: Giving closer neighbours more weightThis chapter assumes you know how plain k-NN classifies by majority vote, what Euclidean distance is, and how to use scikit-learn estimators with fit and predict.2 min read
08Chapter 8: Predicting numbers with k-NN regressionThis chapter assumes you know how k-NN classification works, how Euclidean distance is computed, and why features are scaled before distances are compared. Here the target is a number instead of a class label.3 min read
09Chapter 9: Tuning k and weights with cross-validationThis chapter assumes you know how k-NN votes, why k trades bias against variance, and why features need scaling. It shows how to pick k and the voting rule from data without touching the test set.3 min read
10Chapter 10: The curse of dimensionalityThis chapter assumes you know how k-NN classifies with Euclidean distance, why features need scaling, and how to use NumPy and scikit-learn. It explains why neighbour quality drops as the number of features grows.3 min read
12Chapter 12: Practical pitfalls: ties, imbalance, categorical data and memoryThis chapter assumes you know how k-NN classifies by majority vote, how distance metrics work, and why features must be scaled. It covers four problems that appear once you move from toy data to real data. For each one, it explains what goes wrong and what to do about it.4 min read
13Chapter 13: Approximate nearest neighbour search at scaleThis chapter assumes you know how exact k-NN works, how KD-trees and ball trees speed up search, and why distances lose meaning in high dimensions. It covers what to do when exact search is still too slow.3 min read