3.1 What is the k-nearest neighbors algorithm?
3.1.1 How does the k-nearest neighbors algorithm learn?
3.1.2 What happens if the vote is tied?
3.2 Building your first kNN model
3.2.1 Loading and exploring the diabetes dataset
3.2.2 Using mlr to train your first kNN model
3.2.3 Telling mlr what we’re trying to achieve: Defining the task
3.2.4 Telling mlr which algorithm to use: Defining the learner
3.2.5 Putting it all together: Training the model
3.3 Balancing two sources of model error: The bias-variance trade-off
3.4 Using cross-validation to tell if we’re overfitting or underfitting
3.5 Cross-validating our kNN model
3.5.1 Holdout cross-validation
3.5.2 K-fold cross-validation
3.5.3 Leave-one-out cross-validation
3.6 What algorithms can learn, and what they must be told: Parameters and hyperparameters
3.7 Tuning k to improve the model
3.7.1 Including hyperparameter tuning in cross-validation
3.7.2 Using our model to make predictions
3.8 Strengths and weaknesses of kNN
Solutions to exercises