Machine Learning from Scratch Cover

FOUR VOLUME PDFS + COMPANION CODE

Machine Learning from Scratch

Understand the math. Work through the code. Keep the complete four-volume edition beside you as you learn.

2,922 pages across 4 volumes$68 one-time
Explore individual volumes

Become a confident machine learning practitioner.

Being confident in machine learning means being able to explain your choices. You can look at a dataset, recognise the assumptions behind a method, and decide whether the result is useful.

This book helps you build that judgment by connecting the mathematical ideas to worked examples and runnable Python. You can follow the reasoning, change the code, and see how the result responds.

See what’s included

Connect the foundations to the models

Follow the full series from statistics and hypothesis testing through regression, trees, forecasting, and optimization, with the math and implementation together.

Build understanding you can return to

Keep the explanations and companion notebooks beside you as you learn. When you meet a familiar problem in a new project, revisit the derivation and adapt the example with a clearer understanding of what it assumes.

Own the library

The whole book, beautifully typeset, yours forever.

Reading online is free, and always will be. The paid edition unlocks every current volume as its own carefully typeset PDF. There is intentionally no combined PDF.
  • All ~2,922 pages across 4 standalone volume PDFs

  • 4 focused volume PDFs, delivered separately.

  • Companion notebooks for every volume, with locked dependencies

  • All future expansions, updates, and errata, free, forever

  • Downloadable editions for durable offline reading

  • EPUB edition included when it ships

Best value, save $28 (29%)

$68

one-time

instead of $96 for the 4 volumes bought separately

Machine Learning from Scratch Cover
5.0 from 12 readers
Start with a single volume · $24

Secure checkout via Stripe · PDF and notebook links delivered to your inbox

Reader verdict

5.0

out of 5

12 five-star reader reviews

Genuine feedback, with names abbreviated for privacy.

Meet the community
“I would like to thank you for your work. Specifically, the chapter: 'LIME Explainability: Complete Guide to Local Interpretable Model-Agnostic Explanations' was extremely helpful for me in understanding LIME and communicating to colleagues. Your work is inspiring and valuable. Thank you for doing it.”
Will G.Data Scientist
“Really appreciate the way you have explained the concepts. Simple to understand, yet builds up knowledge exponentially, all while reinforcing it with examples repeatedly. I've read the last two chapters `74.Self-attention & 75.Q,K,V` and I've to admit, my concepts have never been clearer. You really are doing an amazing job breaking down maths and complex concepts like a story!”
Muhammad H.AI/ML Engineer
“I am enjoying reading your writings. I appreciate the effort you put into it. I want to drop a note of thanks. Thank you!”
Krishnan S.Researcher
“I found your book Language AI Handbook's explanations of Transformer architectures and production deployment strategies to be exceptionally clear and insightful”
San Z.Researcher
“Your writing feels like a treasure trove of great material. So, thank you for compiling everything on your website!”
Griffin P.Quantitative Researcher
“Thanks so much for establishing such an amazing community. I appreciate the opportunity to be a learner and a contributor to the community.”
Cyrille L.AI/ML Engineer
“Thank you Michael. It's top!”
David X.Data Scientist
“I read a few of your blogs on NLP and oh WOW, they really are something, now I exactly know how all of the terms Entropy, Cross-entropy and how it is connected to Perplexity, will definitely read more of your blogs.”
Kanishk K.Reader
“I came across your collection of online handbooks covering quantitative finance, AI, and machine learning. I wanted to reach out and thank you for making such high-quality material openly available. They are incredibly helpful for my CFA Level II review and for brushing up ahead of ML interviews.”
Karim Z.Reader
“I just came across your website where your books are available for free to read. Thank you so much for making this available to the public. This will help a lot of people.”
Vikas C.AI/ML Engineer
“Thanks for putting cool stuff out into the world.”
Charlie B.Applied AI
“I came across one of your books, Language AI Handbook, and man, I'm loving it. I've read many books but have never found such a comprehensive book on large models that covers everything from start to finish with such depth.”
Uon L.Reader
Read all 12 reader reviews
“I would like to thank you for your work. Specifically, the chapter: 'LIME Explainability: Complete Guide to Local Interpretable Model-Agnostic Explanations' was extremely helpful for me in understanding LIME and communicating to colleagues. Your work is inspiring and valuable. Thank you for doing it.”
Will G.Data Scientist
“Really appreciate the way you have explained the concepts. Simple to understand, yet builds up knowledge exponentially, all while reinforcing it with examples repeatedly. I've read the last two chapters `74.Self-attention & 75.Q,K,V` and I've to admit, my concepts have never been clearer. You really are doing an amazing job breaking down maths and complex concepts like a story!”
Muhammad H.AI/ML Engineer
“Thanks so much for establishing such an amazing community. I appreciate the opportunity to be a learner and a contributor to the community.”
Cyrille L.AI/ML Engineer
“I just came across your website where your books are available for free to read. Thank you so much for making this available to the public. This will help a lot of people.”
Vikas C.AI/ML Engineer
“I am enjoying reading your writings. I appreciate the effort you put into it. I want to drop a note of thanks. Thank you!”
Krishnan S.Researcher
“Thank you Michael. It's top!”
David X.Data Scientist
“Thanks for putting cool stuff out into the world.”
Charlie B.Applied AI
“I found your book Language AI Handbook's explanations of Transformer architectures and production deployment strategies to be exceptionally clear and insightful”
San Z.Researcher
“Your writing feels like a treasure trove of great material. So, thank you for compiling everything on your website!”
Griffin P.Quantitative Researcher
“I came across your collection of online handbooks covering quantitative finance, AI, and machine learning. I wanted to reach out and thank you for making such high-quality material openly available. They are incredibly helpful for my CFA Level II review and for brushing up ahead of ML interviews.”
Karim Z.Reader
“I read a few of your blogs on NLP and oh WOW, they really are something, now I exactly know how all of the terms Entropy, Cross-entropy and how it is connected to Perplexity, will definitely read more of your blogs.”
Kanishk K.Reader
“I came across one of your books, Language AI Handbook, and man, I'm loving it. I've read many books but have never found such a comprehensive book on large models that covers everything from start to finish with such depth.”
Uon L.Reader

Prefer to start with a single volume?

Machine Learning from Scratch, Volume 1: Statistical Foundations and Hypothesis Testing cover
Volume 1
Statistical Foundations and Hypothesis Testing
Statistical Foundations for Machine Learning · Hypothesis Testing · 430 pages
Future PDF updates included
Explore volume
Machine Learning from Scratch, Volume 2: Linear and Generalized Linear Models cover
Volume 2
Linear and Generalized Linear Models
Model Fundamentals and Diagnostics · Model Evaluation and Selection · Linear and Generalized Linear Models · Survival Analysis · 961 pages
Future PDF updates included
Explore volume
Machine Learning from Scratch, Volume 3: Trees, Explainability, and Unsupervised Learning cover
Volume 3
Trees, Explainability, and Unsupervised Learning
Supervised Learning Beyond Linear Models · Tree-Based Models · Unsupervised Learning · Dimensionality Reduction · Model Interpretation · Calibration and Prediction Uncertainty · 911 pages
Future PDF updates included
Explore volume
Machine Learning from Scratch, Volume 4: Forecasting and Optimization cover
Volume 4
Forecasting and Optimization
Time Series Forecasting · Constrained Optimization · Heuristic and Evolutionary Optimization · 620 pages
Future PDF updates included
Explore volume

Buy 3 volumes and all-volume access unlocks free. Already own volumes? Upgrade to all-volume access and you only pay the difference.

What the PDF edition includes

PDFs formatted for reading

All 2,922 pages designed for reading, figures, math, and code set properly for screen, tablet, and print.

The complete companion code

Every chapter ships as a runnable notebook. Download it, run it, break it, and rebuild it yourself.

Free updates, forever

Every future expansion, revision, and erratum is included. Buy once, your copy never goes stale.

EPUB included when it ships

Buy once and get every format. The EPUB edition is in the works and will be added to your library at no extra cost.

Delivered to your inbox

Download links arrive by email right after checkout, no account hoops, no waiting.

Secure checkout

Payments are handled end-to-end by Stripe. Your card details never touch this site.

Author and edition details

About the author and PDF edition

Michael Brenndoerfer, author of Machine Learning from Scratch

Michael Brenndoerfer

Michael has spent more than a decade working across software engineering, data, AI, and business. He writes to understand difficult ideas more deeply and to share what he learns in a clear, practical way.

Edition
PDF 2026.10.0
Published
Last reviewed

Version history

Kept current, not frozen in time

Each PDF purchase includes future editions. When the book changes, the updated copy appears in My books at no extra cost.

Current release

Edition 2026.10.0

Expanded from 66 to 92 chapters across 15 parts, with model evaluation, survival analysis, supervised learning, calibration, conformal prediction, forecasting validation, and heuristic optimization. Includes corrected original chapters, refreshed print navigation and typography, and updated companion code.

Earlier releases6
  1. 2026.08.2

    Editorial improvements.

  2. 2026.08.1

    Editorial refinements, restored plot typography, clearer logarithmic axes, and refreshed companion code.

  3. 2026.08.0

    Editorial improvements throughout the book, with clearer explanations, refined presentation, improved plots and visualizations, and refreshed companion code.

  4. 2026.07.2

    Improved companion notebooks and validation; removed the obsolete CLT appendix; updated the support contact.

  5. 2026.07.1

    Validation edition bump: fixed typos in the SSE chapter.

  6. 2026.07.0

    Initial public PDF and companion-code release.

Questions, answered

Is the book still free to read online?

Yes, the entire book stays free to read online. The paid edition includes downloadable volume PDFs, companion code, and future updates.

What exactly do I get when I buy?

The complete book includes four separate PDFs, the full companion notebook code, and all future updates. A single-volume purchase includes that volume’s PDF, code, and updates.

Can I buy just one volume?

Yes. Each of the four volumes is $24. And if you buy three volumes, the complete book unlocks free.

Will there be an EPUB version?

Yes, the EPUB edition is in the works, and it's included with your purchase at no extra cost the moment it ships.

How is the book delivered?

Right after checkout you'll get an email with your personal download links. Buy on any device; read on all of them.