# 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: November 19, 2026

## [Module 1: Learning from Examples](https://www.ask-codey.com/courses/machine-learning-python/modules/1)

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](https://www.ask-codey.com/courses/machine-learning-python/chapters/ml-getting-started) (5 topics, 11 lessons)
- [The Python and pandas You Need](https://www.ask-codey.com/courses/machine-learning-python/chapters/ml-python-and-pandas-you-need) (4 topics, 11 lessons)
- [What a Model Is](https://www.ask-codey.com/courses/machine-learning-python/chapters/ml-what-a-model-is) (4 topics, 6 lessons)
- [The Data a Model Needs](https://www.ask-codey.com/courses/machine-learning-python/chapters/ml-data-a-model-needs) (4 topics, 5 lessons)

## [Module 2: Predicting Numbers](https://www.ask-codey.com/courses/machine-learning-python/modules/2)

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](https://www.ask-codey.com/courses/machine-learning-python/chapters/ml-linear-regression) (3 topics, 5 lessons)
- [Measuring Error](https://www.ask-codey.com/courses/machine-learning-python/chapters/ml-measuring-error) (3 topics, 5 lessons)
- [Beyond a Straight Line](https://www.ask-codey.com/courses/machine-learning-python/chapters/ml-beyond-a-straight-line) (4 topics, 5 lessons)

## [Module 3: Predicting Categories](https://www.ask-codey.com/courses/machine-learning-python/modules/3)

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](https://www.ask-codey.com/courses/machine-learning-python/chapters/ml-classification) (4 topics, 5 lessons)
- [Trees and Neighbors](https://www.ask-codey.com/courses/machine-learning-python/chapters/ml-trees-and-neighbors) (3 topics, 5 lessons)
- [Measuring a Classifier](https://www.ask-codey.com/courses/machine-learning-python/chapters/ml-measuring-a-classifier) (5 topics, 8 lessons)

## [Module 4: Making Models Better, Honestly](https://www.ask-codey.com/courses/machine-learning-python/modules/4)

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](https://www.ask-codey.com/courses/machine-learning-python/chapters/ml-overfitting-and-cross-validation) (3 topics, 6 lessons)
- [Preparing Data in a Pipeline](https://www.ask-codey.com/courses/machine-learning-python/chapters/ml-preparing-data-in-a-pipeline) (3 topics, 6 lessons)
- [Data Leakage](https://www.ask-codey.com/courses/machine-learning-python/chapters/ml-data-leakage) (3 topics, 4 lessons)
- [Tuning and Comparing Models Fairly](https://www.ask-codey.com/courses/machine-learning-python/chapters/ml-tuning-and-comparing) (5 topics, 6 lessons)

## [Module 5: Groups, Fairness and Explaining](https://www.ask-codey.com/courses/machine-learning-python/modules/5)

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](https://www.ask-codey.com/courses/machine-learning-python/chapters/ml-finding-groups) (4 topics, 7 lessons)
- [Explaining a Model](https://www.ask-codey.com/courses/machine-learning-python/chapters/ml-explaining-a-model) (4 topics, 6 lessons)
- [Bias and Fairness](https://www.ask-codey.com/courses/machine-learning-python/chapters/ml-bias-and-fairness) (3 topics, 4 lessons)
- [Trusting a Model in the Real World](https://www.ask-codey.com/courses/machine-learning-python/chapters/ml-trusting-a-model) (4 topics, 5 lessons)

Source: https://www.ask-codey.com/courses/machine-learning-python
