Machine learning (ML) is the part of artificial intelligence in which a computer makes decisions from data. Rather than writing a separate instruction for every case, you give the computer past examples and use the patterns in those examples to make a decision about a new case. It is like using experience—called data in computing—to guide a choice. section 1.6 section 1.14
A simple way to picture the process is remember-formulate-predict. First, remember previous data. Next, formulate a model: a set of rules that represents that data. Finally, use the model to predict an unseen case. An algorithm is the procedure—the sequence of steps—that builds the model. section 1.14 section 1.10
Predicting spam from past email
Suppose 6 of the last 10 emails from one sender were spam. A first model can state that 6 out of every 10 emails from that sender are spam. For a new email, it predicts spam as the more likely outcome: 60% spam versus 40% ham. The prediction can be wrong, but it follows the best rule available from the remembered data. section 1.11
Machine learning can support many kinds of data-based decisions, including:
- Predicting a numerical value, such as a house or stock price. section 2.0
- Classifying an item, such as spam versus non-spam email or an image containing a face or animal. section 2.0
- Grouping similar people or items, such as market segments or app users. section 2.0
- Recommending videos, movies, or apps from information about users and choices. section 2.0 section 9.2
Much introductory machine learning is predictive: it answers a category question, such as “is this spam?”, or a numerical question, such as “what will this house cost?” These correspond to classification and regression. Generative machine learning instead creates new material; transformers can write text and diffusion models can draw images. Generative work is presented as a harder step beyond prediction. section 1.13
Learning machine learning starts with pattern-spotting and small examples, not advanced expertise. Formulas become clearer when translated into a concrete numerical or everyday example, and code can be read as a sequence of simple steps. Models may first be built from scratch for understanding; more complex work can use Scikit-Learn, Turi Create, or Keras. section 1.2 section 1.3
Figure 1.5 A very simple machine learning model
Use the diagram to follow how remembered email counts become a simple rule and then a spam prediction. section 1.11
















































