Patterns, Predictions, and Actions

A story about machine learning

Moritz Hardt and Benjamin Recht

Image copyright: Princeton University Press


Princeton University Press


Full preprint as PDF

Table of contents


  1. Introduction (PDF)
  2. Fundamentals of prediction (PDF)
  3. Supervised learning (PDF)
  4. Representations and features (PDF)
  5. Optimization (PDF)
  6. Generalization (PDF)
  7. Deep learning (PDF)
  8. Datasets (PDF)
  9. Causality (PDF)
  10. Causal inference in practice (PDF)
  11. Sequential decision making and dynamic programming (PDF)
  12. Reinforcement learning (PDF)
  13. Epilogue (PDF)
  14. Mathematical background (PDF)

Contact us

We welcome your feedback, questions, and suggestions. You can reach us at If you taught from the book, we’d love to hear about it.

Citations, license, typesetting

Please cite the print edition of this book as:

  author = {Moritz Hardt and Benjamin Recht},
  title = {Patterns, predictions, and actions: Foundations of machine learning},
  year = {2022},
  publisher = {Princeton University Press}
  • We maintain an archival version of the book at arXiv:2102.05242. The web version is more up-to-date than the arXiv version. The print version contains additional improvements and editing not present in the web version.

  • The text available on this website is licensed under the Creative Commons BY-NC-ND 4.0 license.

  • This book is typeset using pandoc with the unbuch setup.

Last updated: Wed May 31 15:29:59 CEST 2023