Machine Learning with Python
Learn how machine learning really works, from the everyday idea of guessing from examples to models you can trust: predict numbers and categories with…
Updated
Module 1: Learning from Examples
Find out what machine learning really is before writing a model: set up Python, scikit-learn and a notebook, refresh the Python and pandas a model needs, learn what training and testing mean, when a simple rule beats a model, and the little statistics that tell you what's in your data. Then decide, for six real problems, whether machine learning fits.
- Getting Started with Machine Learning (5 topics, 11 lessons)
- The Python and pandas You Need (4 topics, 11 lessons)
- What a Model Is (4 topics, 6 lessons)
- The Data a Model Needs (4 topics, 5 lessons)
Module 2: Predicting Numbers
Train your first real models to predict a number: a home's price, a delivery's minutes, an orchard's harvest. Fit a line with scikit-learn, hold back a test set, measure how far off the guesses are in ways a person understands, compare against the simplest guess, and try curves and trees when a straight line isn't enough. Then predict a bike share's daily rentals from the weather.
- Your First Model: Linear Regression (3 topics, 5 lessons)
- Measuring Error (3 topics, 5 lessons)
- Beyond a Straight Line (4 topics, 5 lessons)
Module 3: Predicting Categories
Predict a category: spam or not, which kind of fruit, a card payment that might be fraud. Train logistic regression, decision trees and nearest neighbors, then measure them honestly: accuracy, the confusion matrix, precision and recall, and what happens when the thing you're looking for is rare. Then predict which library members will renew.
- Classification with Logistic Regression (4 topics, 5 lessons)
- Trees and Neighbors (3 topics, 5 lessons)
- Measuring a Classifier (5 topics, 8 lessons)
Module 4: Making Models Better, Honestly
A model that looks great in testing and fails in real use is the most common machine learning mistake. Spot overfitting, score models with cross-validation, prepare numbers, categories and missing values inside a pipeline, find the leaks that let the answer sneak into training, and tune and compare models fairly. Then fix a model that only seemed to work.
- Overfitting and Cross-Validation (3 topics, 6 lessons)
- Preparing Data in a Pipeline (3 topics, 6 lessons)
- Data Leakage (3 topics, 4 lessons)
- Tuning and Comparing Models Fairly (5 topics, 6 lessons)
Module 5: Groups, Fairness and Explaining
Find groups in data that has no labels with k-means, and say what each group means without claiming more than the data shows. Explain a model's results to someone who isn't technical, measure whether it treats groups of people differently, and decide when a model shouldn't be trusted or used. Then find a grocery's shopper groups and explain each in plain words.
- Finding Groups with k-means (4 topics, 7 lessons)
- Explaining a Model (4 topics, 6 lessons)
- Bias and Fairness (3 topics, 4 lessons)
- Trusting a Model in the Real World (4 topics, 5 lessons)