Feedback and Error
Imagine a basketball player who practices free throws with their eyes closed and never finds out whether the ball went in. They might feel like they are doing great — but without feedback, they have no way to improve. Feedback is what makes practice meaningful. In machine learning, the feedback signal is called error or loss — a precise mathematical measure of how wrong the model's prediction was. Without it, the training loop you studied in Lesson 2 would have nothing to act on.
What Is Error (Loss)?
Error, also called loss, is a number that measures the gap between what the model predicted and what the correct answer actually was. The larger the error, the worse the prediction. The goal of training is to minimize this number — to drive it as close to zero as possible across all training examples. For a regression problem (predicting a number), a common way to measure error is to simply calculate the difference between the predicted value and the true value. If the model predicted a house price of $300,000 and the real price was $350,000, the error is $50,000. To avoid positive and negative errors canceling each other out, this difference is usually squared — giving a measure called mean squared error. For a classification problem (predicting a category), error is measured differently. The model outputs a probability for each possible category, and the error measures how far those probabilities are from 'perfect confidence in the right answer.' This measure is called cross-entropy loss. The math is more complex, but the idea is the same: small error means the model is confident and correct; large error means it is either wrong or uncertain.
Loss (error) is the feedback signal that tells the model which direction to improve. The entire process of training — adjusting millions of parameters — is guided by one goal: make the loss smaller. Loss is not just a report card; it is an active guide.
Here is how error works in practice during the training loop from Lesson 2. Example: a model is learning to recognize handwritten digits. It sees an image of a handwritten '7.' Its current (untrained) parameters produce output probabilities like this: 0: 5%, 1: 3%, 2: 8%, 3: 12%, 4: 6%, 5: 9%, 6: 7%, 7: 15%, 8: 18%, 9: 17% The correct answer is 7, but the model only gives it 15% confidence — it actually thinks '8' is most likely. The loss is high. After adjustment, the model might produce: 7: 72%, 8: 10%, 9: 8% (everything else lower) Now 7 wins confidently. The loss is much lower. After thousands more examples and adjustments, the model learns to be highly confident on digits it recognizes clearly. This is feedback turning into learning — exactly the same principle as the basketball player who watches the ball and adjusts their release angle each time.
Match each error concept to its correct description.
Terms
Definitions
Drag terms onto their definitions, or click a term then click a definition to match.
Error as a Signal for Improvement
The power of error is not just that it measures failure — it is that it gives the model a direction to move. When the loss is high, the gradient descent algorithm (from Lesson 2) uses the loss to calculate how each parameter should change to produce a lower loss next time. Parameters that contributed to the wrong prediction get nudged in the direction of correctness. This feedback loop is what makes machine learning self-correcting. No human needs to look at the model's parameters and decide what to change. The math does it automatically, guided entirely by the loss signal. Over many thousands or millions of training examples, the cumulative effect of these small adjustments is a model that has learned to produce low-loss predictions — in other words, a model that usually gets the right answer.
A model can achieve very low loss on its training data by memorizing the examples rather than learning general patterns. If you only measure training loss, you might think the model is excellent when it is actually just good at cheating. This is why, as you will see in Lesson 7, you always evaluate on data the model has never seen.
In a regression task, the model predicts 82 but the true answer is 90. What is the raw prediction error?
Why is error (loss) described as a 'compass' for training?
Map the Feedback
- Think of a skill you have personally practiced and improved at — a sport, a musical instrument, cooking, a video game, or anything else.
- Step 1: Identify the 'feedback signal' — how did you know when you got it wrong? Be specific. (Example: the note sounded sharp; the basket clanged off the rim.)
- Step 2: Identify the 'adjustment' — what did you change as a result of that feedback?
- Step 3: Identify how the feedback changed over time as you improved. Did you start noticing more subtle errors that you could not see at the beginning?
- Step 4: Write one paragraph connecting your experience to how a machine learning model uses loss as a feedback signal. What is similar? What is different?