Build classifiers for real problems with Python and scikit-learn — logistic regression, k-NN, decision trees, random forests and an overview of SVMs. You will learn the fit/predict workflow, read probability outputs, handle class imbalance, and work a full classification example end to end.
Watch the free preview
What classification is and how scikit-learn fits a model — free to watch, no account needed.
What you'll learn
- Build classifiers for real problems with scikit-learn using the fit/predict workflow
- Apply logistic regression, k-NN, decision trees and random forests to labelled data
- Read and calibrate probability outputs to make threshold decisions
- Evaluate classifiers with the confusion matrix, precision, recall, F1 and ROC-AUC
- Diagnose and correct class imbalance so the minority class is not ignored
Syllabus
Classification and the fit/predict Workflow
What classification is and how scikit-learn fits a modelFree preview
Logistic regression — the linear baseline classifier
Neighbours and Trees
k-Nearest Neighbours — classify by similarity
Decision trees — rules you can read
Ensembles, SVMs and Probabilities
Random forests — many trees, less variance
Support vector machines and probability outputs
Evaluation and Class Imbalance
Evaluating classifiers beyond accuracy
Class imbalance — stopping the minority class being ignored
Lab — 10 Exercises & Solutions
Exercises 1–5
Exercises 6–10