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.

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.

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.

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.

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.