# What a Model Is

Before any model: what it means to guess from examples, the kinds of machine learning and the questions each answers, why a model is always tested on examples it never saw, and the simplest guess every model has to beat. Then the honest part: the problems where a rule, a query or a person does better. The running example is a bakery deciding how many loaves to bake.

Updated: November 19, 2026

## [Models in Plain Words](https://www.ask-codey.com/courses/machine-learning-python/topics/ml-models-in-plain-words)

1. [Guessing from Examples](https://www.ask-codey.com/lessons/ml-guessing-from-examples) (Novice): A rule you write comes from memory, while a rule learned from past examples comes from the data, and that learned rule is a model; each example is a row, the features are the columns it looks at, and the label is the column it learns to guess.
2. [Kinds of Machine Learning](https://www.ask-codey.com/lessons/ml-kinds-of-machine-learning) (Apprentice): Supervised learning learns from examples that come with answers, regression when the answer is a number and classification when it's a category, while unsupervised learning finds groups in examples with no answers, and reinforcement learning, learning by trial and reward, is outside this course.

## [Training and Testing](https://www.ask-codey.com/courses/machine-learning-python/topics/ml-training-and-testing-topic)

1. [Training and Testing: Never Grade Your Own Homework](https://www.ask-codey.com/lessons/ml-training-and-testing) (Apprentice): A model scored on the examples it learned from can look perfect and still be useless, so some examples are held back as test data that it never sees while it trains, and when the data is in time order, the most recent days are the ones held back.
2. [The Simplest Guess: Baselines](https://www.ask-codey.com/lessons/ml-baseline-guesses) (Apprentice): A baseline is the simplest guess there is, always the training data's average for a number or its most common answer for a category, and every model has to beat it on the test data by enough to be worth the trouble.

## [When Not to Use Machine Learning](https://www.ask-codey.com/courses/machine-learning-python/topics/ml-when-not-to-use-it)

1. [When Machine Learning Is the Wrong Tool](https://www.ask-codey.com/lessons/ml-when-ml-is-the-wrong-tool) (Apprentice): Machine learning is the wrong tool when a rule is already known, when a query on the data already holds the answer, when there are too few examples or the data doesn't hold the answer, when every decision must be explained exactly, or when a wrong guess costs too much, and a six-question checklist catches each case.

## [Exercise: How Many Loaves?](https://www.ask-codey.com/courses/machine-learning-python/topics/exercise-ml-how-many-loaves)

1. [Exercise: How Many Loaves?](https://www.ask-codey.com/lessons/exercise-ml-how-many-loaves) (Apprentice): Write four plain-Python functions that hold back Sunrise Bakery's last two weeks as test days, guess them with the average and with a weekday rule learned from the training days, and measure each guess's average miss, and let pytest check the split, the arithmetic and that no test day goes into a guess.

Source: https://www.ask-codey.com/courses/machine-learning-python/chapters/ml-what-a-model-is
