This book is licensed for the personal use of the buyer. Please do not share or resell the file. Short quotations with attribution are welcome.
The information in this book is provided for education. It is not legal, financial or other professional advice. Product and company names are used only to describe them and belong to their owners.
This is a free sample: the introduction and first chapter.
IntroductionIntroduction
Machine learning is built on statistics. Every model learns from a sample of data and is used on data it has never seen. Every evaluation is an estimate with uncertainty. Every comparison between models is, implicitly, a statistical test. Yet many practitioners learn to train models long before they learn the ideas underneath, and pay for it with overconfident conclusions, misleading comparisons and models that fail in production.
This book fills that gap. It explains the statistics that matter most for machine learning in plain words first, then with small worked examples you can follow with a calculator. It connects each idea to practice: describing data, reasoning with probability, estimating with confidence, testing claims, measuring relationships, and evaluating and comparing models.
How the book is organised
Chapters 1 to 6 describe data: types, averages, spread, percentiles and distributions.
Chapters 7 to 13 build probability: rules, conditional probability, Bayes' rule, random variables and the binomial and normal distributions.
Chapters 14 to 22 cover inference: sampling, the central limit theorem, standard errors, confidence intervals, hypothesis tests, p-values, A/B tests, power and multiple comparisons.
Chapters 23 to 26 cover relationships: correlation, causation and regression.
Chapters 27 to 30 connect statistics to machine learning: overfitting, cross-validation, the bootstrap and Bayesian thinking.
Chapters 31 to 34 add counts and waiting times, t-tests, odds and logistic regression, and a checklist for evaluating models.
Exercises with answers and a glossary close the book.
Chapter 1Why Statistics Matters for Machine Learning
Consider three common situations.
A new model scores 86% accuracy on the test set; the old one scored 84%. Is the new one better, or did it get luckier examples?
A feature is strongly correlated with the target. Should you use it, and does it cause the outcome?
A model was trained on last year's customers. Will it work for next year's?
Each question is statistical. The first concerns uncertainty in estimates, the second the difference between association and causation, the third the relationship between a sample and the population it represents. Machine-learning libraries will happily produce numbers in all three cases; only statistical thinking tells you what they mean.
Three core ideas
Variation: data varies, and so do summaries computed from it.
Sampling: we observe a sample and want to learn about a population.
Uncertainty: conclusions from samples should come with honest measures of doubt.
You have reached the end of the free sample. The full book continues with 33 more chapters, plus the appendices.