
Trees, Explainability, and Unsupervised Learning
Decision trees and the ensembles that dominate tabular machine learning (random forests through XGBoost, LightGBM, and CatBoost), plus model explainability (SHAP, LIME), dimensionality reduction (PCA, t-SNE, UMAP), and clustering from k-means to HDBSCAN. Supervised alternatives, neural networks, Gaussian mixtures, calibration, and conformal prediction add model comparisons and explicit uncertainty assumptions.
One part of Machine Learning from Scratch. The complete book remains free to read online; this paid edition is the carefully typeset PDF and companion notebook package you keep.
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 you’ll learnMake sense of patterns and predictions
Understand how trees split data, how explanations describe predictions, and what clustering and dimensionality reduction reveal.
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.
Learning outcomes
What you will learn
- Build decision trees and understand how random forests and boosted ensembles improve them.
- Compare XGBoost, LightGBM, CatBoost, and isolation forests by objective and operating trade-offs.
- Explain model behavior with SHAP and LIME and reduce dimensions with PCA, t-SNE, and UMAP.
- Choose and evaluate k-means, hierarchical, density-based, and HDBSCAN clustering.
Audience and prerequisites
Who this volume is for
- Practitioners working with tabular data, nonlinear models, or model explainability.
- Data scientists who need a principled path from supervised ensembles to unsupervised learning.
- Engineers and analysts evaluating clustering and dimensionality-reduction methods for real datasets.
Prerequisites: Assumes the model-evaluation fundamentals from Volumes 1 and 2: loss, overfitting, regularization, and cross-validation.
Volume 3 PDF + code
Own this 911-page edition
Get the PDF, the runnable companion notebooks, and every future update and erratum for this volume. The corresponding online chapters stay free to read.
- Carefully typeset PDF
- Companion code for every included chapter
- Future updates and errata included
- Online chapters remain free to read
Volume 3 of 4
$24
one-timeVersion 2026.10.0 · 911 pages · secure checkout via Stripe
Delivered by email · Free updates included
Want the complete series?
All 4 volumes · 2,858 pages · complete companion code. Save $28 vs. buying all four separately.
Buy the complete book · $68Reader verdict
5.0
out of 5
12 five-star reader reviews
Genuine feedback, with names abbreviated for privacy.
Meet the community“I am enjoying reading your writings. I appreciate the effort you put into it. I want to drop a note of thanks. Thank you!”
“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.”
“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.”
“I found your book Language AI Handbook's explanations of Transformer architectures and production deployment strategies to be exceptionally clear and insightful”
“Your writing feels like a treasure trove of great material. So, thank you for compiling everything on your website!”
“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!”
“Thank you Michael. It's top!”
“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.”
“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.”
“Thanks so much for establishing such an amazing community. I appreciate the opportunity to be a learner and a contributor to the community.”
“Thanks for putting cool stuff out into the world.”
“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.”
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.”
“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!”
“Thanks so much for establishing such an amazing community. I appreciate the opportunity to be a learner and a contributor to the community.”
“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.”
“I am enjoying reading your writings. I appreciate the effort you put into it. I want to drop a note of thanks. Thank you!”
“Thank you Michael. It's top!”
“Thanks for putting cool stuff out into the world.”
“I found your book Language AI Handbook's explanations of Transformer architectures and production deployment strategies to be exceptionally clear and insightful”
“Your writing feels like a treasure trove of great material. So, thank you for compiling everything on your website!”
“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.”
“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.”
“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.”
Exact contents
25 chapters across 6 parts
Every chapter below is included in the PDF and companion code. Links open the corresponding chapter in the free online edition.
Supervised Learning Beyond Linear Models
Tree-Based Models
Unsupervised Learning
Dimensionality Reduction
Model Interpretation
Calibration and Prediction Uncertainty
Choose the edition that fits your next step
Volume 3: Trees, Explainability, and Unsupervised Learning
Focus on Supervised Learning Beyond Linear Models and Tree-Based Models and Unsupervised Learning and Dimensionality Reduction and Model Interpretation and Calibration and Prediction Uncertainty, with the explanations and code together in one edition.
911 pages · 25 chapters · companion notebooks
$24one-time
Choose this volumeThe complete Machine Learning from Scratch book
Keep the full series beside you as you progress from statistical foundations to models, forecasting, and optimization.
All 4 volumes · 2,858 pages · complete companion code
$68one-time
Get the complete bookBoth editions include future updates. Buying three distinct volumes also unlocks the complete book automatically.
Also in the series
Explore the other volumes

Volume 1 · 430 pages
Statistical Foundations and Hypothesis Testing
Statistical Foundations for Machine Learning · Hypothesis Testing

Volume 2 · 961 pages
Linear and Generalized Linear Models
Model Fundamentals and Diagnostics · Model Evaluation and Selection · Linear and Generalized Linear Models · Survival Analysis

Volume 4 · 620 pages
Forecasting and Optimization
Time Series Forecasting · Constrained Optimization · Heuristic and Evolutionary Optimization
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
2026.08.2
Editorial improvements.
2026.08.1
Editorial refinements, restored plot typography, clearer logarithmic axes, and refreshed companion code.
2026.08.0
Editorial improvements throughout the book, with clearer explanations, refined presentation, improved plots and visualizations, and refreshed companion code.
2026.07.2
Improved companion notebooks and validation; removed the obsolete CLT appendix; updated the support contact.
2026.07.1
Validation edition bump: fixed typos in the SSE chapter.
2026.07.0
Initial public PDF and companion-code release.