Classification

Nearest neighbours, logistic regression, and the metrics that tell a good classifier from a misleading one.

About 5 hours of study

Learning objectives

Lessons

  1. 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. 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. 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

Module quiz

1. k-NN predicts a label by...
2. What is σ(0) for the sigmoid function?
3. TP = 6, FN = 2. What is the recall?
4. Why use an odd k for k-NN with two classes?
5. Logistic regression with w = 4 and b = −8 has its decision boundary at...
6. A fraud model has precision 0.95 and recall 0.10. What does that mean?

‹ Regression and optimizationProbabilities, trees and ensembles ›