Cheat sheets for machine learning with Python

27 one-page references, one for each module of Python, Data Tools, Maths, Statistics and Machine Learning: the terms, rules and common mistakes, with the output each rule produces. Five are free to read with no account.

Free to read, no account needed

One module's sheet from each track, in full, written for the work you will do with it.

  • Python · Module 3: Data Structures

    Python data structures cheat sheet

    Lists, tuples, dictionaries and sets on one page: the terms, which structure to use, the syntax at a glance, the rules and the common mistakes.

  • Data Tools · Module 2: pandas

    pandas cheat sheet

    Selecting, filtering, sorting, grouping, merging and reshaping a table with pandas: each question, the expression that answers it, and how to read the result.

  • Maths · Module 4: Calculus and Optimisation

    Calculus for machine learning cheat sheet

    Derivatives and their rules, minima, the gradient, curvature, integrals, convexity and the backward pass: the calculus model training uses, on one page.

  • Statistics · Module 1: Describing Data and Reading Statistical Plots

    Descriptive statistics cheat sheet

    How to describe a dataset and read its plots: what to fix before any statistic, which view answers which question, the formulas, the code and the gotchas.

  • Machine Learning · Module 3: Linear Regression and Gradient Descent

    Linear regression and gradient descent cheat sheet

    The fitted line, gradient descent, batch and mini-batch updates, multiple regression, conditioning, diagnostics and collinearity, with worked values from Auto MPG.

Every cheat sheet, by track

Each sheet sums up one module: the topics listed are its lessons.

Free to read
No account needed.
Free account
Part of the free sample: open it with a free account.
Pro
Part of Pro.

Python

  • Module 1
    Getting Started cheat sheet

    Covers Why Python?, Run Your First Python Code, Variables, Keywords and Identifiers, Data Types, Input, Output and Formatting, Operators.

    Free account
  • Module 2
    Control Flow cheat sheet

    Covers if, elif and else, while Loops, for Loops and range, break, continue and else on Loops.

    Free account
  • Module 3
    Python data structures cheat sheet

    Covers Lists, Tuples, Sets, Dictionaries, Strings, Comprehensions.

    Free to read
  • Module 4
    Functions cheat sheet

    Covers Defining Functions, Arguments and Scope, Recursion, Lambdas and Functions as Values.

    Free account
  • Module 5
    Organising Code cheat sheet

    Covers Modules and Packages, uv, Packages and Environments, Working with Files, Exceptions, Debugging, Testing with assert and pytest, Formatting, Linting and Type Checking.

    Free account
  • Module 6
    Objects and Classes cheat sheet

    Covers Classes and Objects, Dataclasses, The Estimator Pattern.

    Pro
  • Module 7
    Time and Space Complexity cheat sheet

    Covers Time and Space Complexity, Binary Search, Hash Tables.

    Pro

Data Tools

  • Module 1
    NumPy cheat sheet

    Covers Why NumPy, Shape, dtype and Reshaping, Indexing, Slicing and Masks, Vectorised Operations and Broadcasting, Aggregations Along Axes, Linear Algebra in NumPy, Random Numbers and Reproducibility.

    Free account
  • Module 2
    pandas cheat sheet

    Covers Meet pandas, Series and DataFrames, Selecting and Filtering, Cleaning Data, groupby and Aggregation, Merging, Joining and Reshaping, Dates and Time Series in pandas.

    Free to read
  • Module 3
    Visualisation cheat sheet

    Covers Why Matplotlib and seaborn, Meet Matplotlib, Matplotlib Fundamentals, Several Plots and Readable Charts, The Same Plots with seaborn.

    Pro
  • Module 4
    The scikit-learn API cheat sheet

    Covers Meet scikit-learn, Estimators: fit, predict, transform, Pipelines, and Where scikit-learn Goes Next.

    Pro

Maths

  • Module 0
    Why Maths Matters cheat sheet

    Covers The Maths Inside One Prediction.

    Free account
  • Module 1
    Functions, Logarithms and Notation cheat sheet

    Covers Functions and Their Graphs, Exponents and Logarithms, Reading ML Notation.

    Free account
  • Module 2
    Vectors cheat sheet

    Covers Vectors, Vector Arithmetic and Norms, The Dot Product, Angle and Projection, Lines, Planes and Hyperplanes, Shapes and Distance in d Dimensions.

    Pro
  • Module 3
    Matrices cheat sheet

    Covers Matrices, the Matrix–Vector Product and the Transpose, Matrix Multiplication as Transformation, Identity, Inverse and Singular Matrices, Linear Systems, Rank and Least Squares, Eigenvalues and Eigenvectors, Singular Value Decomposition, The Covariance Matrix.

    Pro
  • Module 4
    Calculus for machine learning cheat sheet

    Covers Derivatives: Rate of Change and the Tangent, Derivative Rules and the Chain Rule, Maxima, Minima and Setting the Derivative to Zero, Partial Derivatives and the Gradient, Curvature: Second Derivatives, Taylor and Newton, Integrals as Area, Convexity, Local Minima and Saddle Points, The Chain Rule Through a Computation, Constrained Optimisation and Lagrange Multipliers.

    Free to read
  • Module 5
    Numbers on a Computer cheat sheet

    Covers Floating Point and Numerical Stability.

    Pro

Statistics

  • Module 0
    Why Statistics Matters cheat sheet

    Covers Why Statistics Matters for ML, AI and Real Decisions, From Question to Evidence to Action.

    Free account
  • Module 1
    Descriptive statistics cheat sheet

    Covers Histograms and Density, The CDF, Percentiles and Quantiles, Mean, Median and Mode, Variance, Standard Deviation and IQR, Box Plots and Violin Plots, Correlation, Confounding and Causation, Who Is in the Dataset?, Categorical Counts, Rates and Bar Plots, Scatter, Joint and Density Plots, Pair Plots and Correlation Heatmaps.

    Free to read
  • Module 2
    EDA, Evidence and Misleading Statistics cheat sheet

    Covers EDA Is a Sequence of Decisions, How Charts Can Mislead, Denominators, Base Rates and Missing Groups, Project Lab: End-to-End EDA for an ML Decision.

    Pro
  • Module 3
    Probability cheat sheet

    Covers Probability Basics, Conditional Probability and Independence, Bayes' Theorem, Random Variables, Expectation and Variance, Monte Carlo Simulation.

    Pro
  • Module 4
    Distributions and Dependence cheat sheet

    Covers Random Sampling, Bernoulli and Binomial Outcomes, The Normal Distribution, Residual Shape and the Q-Q Plot, Long Tails and Log Transforms, The Multivariate Normal, Dependence Over Time.

    Pro
  • Module 5
    Estimation cheat sheet

    Covers Samples, Sampling Distributions and the Central Limit Theorem, Maximum Likelihood Estimation, Confidence Intervals, The Bootstrap, Bayesian Estimation and Credible Intervals.

    Pro

Machine Learning

  • Module 1
    What Machine Learning Is cheat sheet

    Covers What Is Machine Learning?, The Kinds of Machine Learning, The Machine Learning Workflow, Samples, Features and Labels, Where Data Comes From.

    Free account
  • Module 2
    Exploring a Dataset for Modelling cheat sheet

    Covers Features Against the Target, The Modelling Checks: Target, Leakage and Feature Decisions.

    Pro
  • Module 3
    Linear regression and gradient descent cheat sheet

    Covers Simple Linear Regression, Gradient Descent, Gradient Descent for Linear Regression, Multiple Linear Regression, Why Gradient Descent Is Slow: Conditioning and Feature Scaling, Regression Diagnostics and Robust Regression, Collinearity.

    Free to read
  • Module 4
    The First Classifier, Generalisation and Regularisation cheat sheet

    Covers Distance and Similarity, k-Nearest Neighbours, Overfitting, Underfitting and the Test Set, Cross-Validation, Hyperparameter Search, Learning Curves and Validation Curves, Polynomial Regression: Choosing Model Capacity, Ridge Regression, Lasso and Elastic Net, k-NN at Scale: kd-Trees and Hashing.

    Pro

A free account opens the cheat sheets in the free sample: Python modules 1 to 5 and the opening modules of every track. The opens the rest.

A cheat sheet reminds. A lesson teaches.

Each sheet comes from a module of the course, where every rule is taught, practised and checked.