Start here

How to learn machine learning.

Machine learning is a small number of ideas, used over and over. Learn them in the right order and each one makes the next easy. This is that order, with a free chapter for each step.

The short version

  1. Learn what "learning" means on the simplest model there is, a straight line: fitting it, training it step by step with gradient descent, and checking that it works on data it has not seen. Everything else builds on this.
  2. Learn to predict categories. Logistic regression, nearest neighbours, naive Bayes and support vector machines are four different answers to the same question, and how to score a classifier honestly matters as much as any of them.
  3. Build a neural network yourself, one piece at a time, so that deep learning is something you understand rather than a library you call.
  4. Pick up the mathematics as you need it. Vectors, derivatives and probability, only as much as the next chapter uses.

The path, chapter by chapter

Part 0: Toolkitabout 1 h

The three pieces of mathematics the rest of the book leans on. Each chapter covers only what later chapters use, with pictures before formulas. Read them first, or come back when a chapter sends you here.

Part I: Learning from Dataabout 1 h

What it means for a machine to learn, shown on the simplest model there is, a straight line. By the end you will have fitted a model, trained it step by step, and learned how to tell whether it will work on data it has not seen.

You need: School algebra. The toolkit chapters help from chapter 3 onward.

Part II: Classificationabout 1 h

Predicting a category instead of a number. Five different ways to draw the line between yes and no, and how to measure a classifier honestly when one answer is rare.

You need: Part I, especially gradient descent and generalization.

Part III: Trees and Ensembles

Models built from simple yes-or-no questions, and what happens when hundreds of them vote. These are the models that win most often on tables of data.

You need: Part I and the chapter on measuring classifiers.

  • Chapter 11: Decision Trees (being written)
  • Chapter 12: Random Forests (being written)
  • Chapter 13: Boosting (being written)

Part IV: Neural Networksabout 2 h

A neural network built from nothing, one piece per chapter, until it recognises pictures of clothing. Every chapter comes with a short Python file that runs on its own.

You need: Chapters 1 to 4 and 6, and the toolkit chapters on vectors and derivatives.

Part V: Finding Structure

Learning without answers to learn from. Grouping similar things, squeezing many features into a few, and describing data as a blend of simple shapes.

You need: Part I and the toolkit chapters on vectors and probability.

  • Chapter 24: Clustering with k-Means (being written)
  • Chapter 25: Principal Component Analysis (being written)
  • Chapter 26: Mixture Models and EM (being written)

Part VI: Doing It for Real

The work around the model, which is most of the work. Getting data ready, running a project from the first question to the final check, and where to go after this book.

You need: Parts I and II.

  • Chapter 27: Preparing Data (being written)
  • Chapter 28: An End-to-End Project (being written)
  • Chapter 29: Where to Go Next (being written)

Chapters marked "being written" are not published yet. The changelog lists each one as it arrives.

Common questions

How much mathematics do I need to learn machine learning?
School algebra is enough to start. The book's three toolkit chapters teach the vectors, derivatives and probability the later chapters use, with pictures before formulas, and each chapter says which of them it needs.
Do I need to know how to code?
No, not to follow the ideas: every idea is shown with a figure you can use in the browser. To build things yourself, some Python helps. The neural network chapters each come with a short NumPy file that runs on its own.
How long does it take?
The 21 published chapters take about 6 hours to read, plus time for the exercises. A chapter takes 12 to 20 minutes, so one a day gets you through in about a month.
Where does deep learning fit in?
Deep learning means neural networks with many layers. Part IV builds a neural network from nothing, one piece per chapter: neurons, activations, loss, backpropagation, optimizers and regularization, until it recognises photographs of clothing. Read Part I first, because training a network is the same idea as fitting a line, at a larger scale.
Is it really free?
Yes. Every chapter, figure and exercise is free to read with no sign-up, and your progress stays in your own browser.

Ways in

Search

    The Book of Machine Learning
    Search
    Reading settings
    Text size
    Colours

    Saved in this browser only.

    Keyboard shortcuts
    /
    Search the book
    ← →
    Previous and next chapter
    g
    Glossary
    c
    Table of contents
    e
    Jump to the exercises
    t
    Reading settings
    ?
    Show this list
    Esc
    Close a window or pop-in