Classification
Nearest neighbours, logistic regression, and the metrics that tell a good classifier from a misleading one.
About 5 hours of study
Learning objectives
- Classify with k-nearest neighbours
- Train logistic regression with the log loss
- Choose and compute classification metrics
Lessons
- 1
k-nearest neighbours Intermediate
Classify a new example by a vote of the k most similar training examples: Euclidean and Manhattan distances, choosing k, why scaling matters, and the cost of a lazy learner.
- 2
Logistic regression Intermediate
A classifier that predicts probabilities: the sigmoid function, the decision boundary, the log loss, training by gradient descent, and softmax for more than two classes.
- 3
Measuring a classifier Intermediate
Why accuracy can mislead: the confusion matrix, precision, recall and the F1 score, imbalanced data, and choosing a decision threshold for the cost of each kind of mistake.
Module practice
- Euclidean and Manhattan distanceEasy
- k-nearest neighboursMedium
- k-NN with min-max scalingHard
- Scores to probabilitiesEasy
- Log loss and accuracyMedium
- Train a logistic regressionHard
- Accuracy and error countEasy
- Confusion matrix and scoresMedium
- Choose a decision thresholdHard
Module quiz
‹ Regression and optimizationProbabilities, trees and ensembles ›