Learning path · Level 2 · Tutorial 1

How Models Learn from Data

Explain how a model learns and then uses patterns, identifying features, labels, and different forms of learning in small everyday examples.

  • Level: Beginner
  • Duration: 15 min
  • 7 steps
Start tutorial Back to the path
How Models Learn from Data

What you will go through

  1. Find the Features and the Label Identify the opening inputs and observed sales outcome in Maple Café's labeled examples. 2 min
  2. Learn from Labeled Examples See how supervised learning compares predictions with supplied labels and uses that feedback to adjust a model across repeated examples. 2 min
  3. Separate Training from Inference Distinguish using a trained model from later adjusting it with training data or feedback. 2 min
  4. Find Structure without Target Labels Recognize unsupervised learning as a search for structure in café-day features without supplied target labels. 2 min
  5. Learn from Actions and Rewards Learn how reinforcement learning improves action choices through reward feedback, and how this differs from labels and unlabeled structure. 2 min
  6. A Pattern Is Not Proof of a Cause Learn why an observed relationship can support a prediction without proving what caused the outcome. 2 min
  7. Explain a Complete Learning Scenario Apply the full Maple Café case: identify inputs and outcomes, separate inference from training, compare learning feedback, and avoid causal overclaims. 3 min

What you will learn

  • Identify features and labels in a small table of labeled examples.
  • Distinguish a training event from an inference event in an application scenario.
  • Match examples to learning from labels, unlabeled data, or rewards, explaining the feedback available in each case.
  • Explain why a model's prediction does not by itself establish what caused an outcome.

Before you start

  • Distinguishing AI, Machine Learning, and Generative AI
  • Identifying AI Tasks and the Products Around Models

Step 1 of 7

Find the Features and the Label

Identify the opening inputs and observed sales outcome in Maple Café's labeled examples.

Read one labeled table

A row is one café day

Maple Café wants to estimate the day's Iced drinks sold from information available at opening.

Each row below is one example: one day with recorded opening information and a sales outcome observed later.

Labeled café examples

The café's four recorded examples

The first two columns describe conditions at opening. Sales are recorded later.
Forecast high (°C)UmbrellasIced drinks sold
16Closed10
22Closed18
28Open34
30Open38

Inputs and outcome

An annotated three-column café table separates Forecast high and Umbrellas as Features available at opening from Iced drinks sold as the Label observed later.

Features are available at opening; the label is the outcome recorded later.

Assign each column a role

Features are inputs; a label is the target

A feature is an input characteristic a model can use. Here, Forecast high (°C) and Umbrellas are features because Maple Café knows them at opening.

A label is the target answer recorded for a labeled example. For this task, Iced drinks sold is the label. A label can be a number: sales counts are labels here, not categories.

Example

The task determines the roles

Column roles depend on the question being predicted. Because the task is to estimate Iced drinks sold, the two opening columns are features and the observed sales column is the label.

Before the day ends, the sales value is unknown, so it can be written as ?. After sales are recorded, that number becomes the observed label for that day.

Practice: features or label?

Check the column roles

Match each table column to its role in Maple Café's prediction task.

Tap an item and then its matching pair.

Step 2 of 7

Learn from Labeled Examples

See how supervised learning compares predictions with supplied labels and uses that feedback to adjust a model across repeated examples.

From labeled data to adjustment

Training uses labeled examples

In supervised learning, each example pairs Features with an observed Label. During training, the model uses many such pairs to adjust how it turns inputs into predictions.

For Maple Café, the features available at opening are the forecast high and umbrella status. The label is the number of iced drinks sold later that day.

The label is not a rule written by a person such as “if it is warm, predict this many drinks.” Instead, it gives the model feedback about how close its prediction was for that example.

One supervised-training cycle

A left-to-right diagram shows Maple Café features entering a model, a prediction of 30 drinks compared with an observed label of 34 drinks, and feedback returning to adjust the model.

The observed label provides feedback that can guide a model adjustment during training.

Compare a prediction with what happened

A worked labeled example

Consider one Maple Café row used during training. The model receives the features, produces a prediction, and then its prediction is compared with the supplied label.

This comparison tells the training process that the prediction of 30 drinks did not match the observed result of 34 drinks. The model can then be adjusted so that patterns across examples are reflected better.

A real training process repeats this cycle across many labeled examples. It does not require someone to write a separate prediction rule for every possible combination of weather and umbrella status.

Example

Maple Café example

Features

  • Forecast high: 28 °C
  • Umbrellas: Open

Prediction
30 drinks

Observed label
34 drinks

The observed label is the recorded outcome used for training feedback.

Practice the sequence

Practice: sequence the cycle

Put the simplified supervised-training cycle in the correct order.

  1. The model produces a prediction from the features.
  2. Adjust the model using the comparison as feedback.
  3. Provide the features and observed label for a café example.
  4. Compare the prediction with the observed label.

Apply the idea

Explain the training cycle

For a Maple Café labeled example, write the four simplified training actions in order. Then add one sentence explaining why the observed label helps adjust the model instead of requiring a person to write a prediction rule for that example.

Write at least 120 characters (0/120).

Step 3 of 7

Separate Training from Inference

Distinguish using a trained model from later adjusting it with training data or feedback.

Use a trained model without changing it

From opening information to a prediction

A prediction uses today’s available inputs

At opening, Maple Café knows the forecast high and whether its umbrellas are open. It does not yet know how many iced drinks will be sold.

When an already trained model takes these features and produces an output, that event is called inference. The unknown label is shown as ? until sales are observed later.

New café day

This new day has features at opening, but its sales label is not yet known.

The `?` means the observed sales outcome is unknown when the prediction is requested.
Forecast high (°C)UmbrellasIced drinks sold
27Open?

Inference flow

A left-to-right flow from the two opening inputs through a trained model to Prediction: 31 drinks, with no feedback arrow.

Inference: features → trained model → Prediction: 31 drinks.

Compare the two events

Prediction, recording, and adjustment

Inference is not an adjustment

For the new day, (27 °C, Open) produces an illustrative Prediction of 31 drinks. Producing that number does not by itself change the model.

Later, Maple Café may record the actual sales as an Observed label. Recording or storing that outcome is also not automatically training. The model changes only if a later training process uses examples or feedback to adjust it.

Two different flows

Training compares a prediction with an observed label and has a return arrow for adjustment; inference ends after a prediction.

Only the training flow includes feedback used for model adjustment.

Example

Same kind of output, different event

Training example: for a past café day with features (28 °C, Open), the model predicts 30 drinks and the observed label is 34 drinks. In supervised learning, that supplied label can guide an adjustment during training.

Inference example: for the new day (27 °C, Open), the trained model displays Prediction: 31 drinks. No observed label is available at that moment, and no adjustment happens merely because the prediction was made.

Check your distinction

Classify the café events

Maple Café has already trained a model. Which description correctly classifies the events?

Step 4 of 7

Find Structure without Target Labels

Recognize unsupervised learning as a search for structure in café-day features without supplied target labels.

Look for patterns in unlabeled features

Features without sales labels

In unsupervised learning, a model looks for structure in data without supplied target labels.

At Maple Café, imagine that we provide only the opening-time features from past days: the forecast high and umbrella status. There is no Iced drinks sold column for the model to learn from. It can still look for days that seem similar.

Unlabeled café-day data

These historical café days contain only the two features. Sales outcomes are deliberately not included.

Feature values available for an illustrative unsupervised-learning task.
Forecast high (°C)Umbrellas
16Closed
22Closed
28Open
30Open

An illustrative grouping

Four café days with only forecast temperature and umbrella status are arranged into Group A and Group B; no sales labels are shown.

The model can group feature patterns even when no target sales answers are supplied.

Interpret a discovered group carefully

Groups are descriptions, not targets

One possible unsupervised task is grouping similar café days. In this illustration, the cooler days with closed umbrellas are called Group A, while the warmer days with open umbrellas are called Group B.

The names are identifiers for the structure found in these records. They are not correct answers supplied before learning, and they do not mean “low sales” or “high sales.”

Example

Keep the claim modest

Illustrative interpretation:

  • Group A describes the two feature records that appear together in this small example.
  • Group B describes the other two feature records.

This grouping does not prove that there are two natural kinds of café days. It also does not automatically predict how many iced drinks Maple Café will sell. A grouping can be useful for exploring patterns, but it is not the same task as predicting a sales label.

Separate missing outcomes from learning setup

An unknown outcome can still be inference

Do not classify a learning setup only by whether a label is missing at one moment.

A supervised model can receive a new café day at opening, before its sales outcome is known. Applying the already trained model to those features is inference. Its unknown outcome does not change the earlier labeled training into unsupervised learning.

The key question is: during learning, were target labels supplied?

Inference has an unknown observed label

A new day's features pass through a model already trained from labeled examples and produce a prediction while the observed label remains unknown.

At prediction time, an unknown observed label reflects timing. It does not determine whether the model learned through supervised or unsupervised learning.

Check your distinction

Identify the learning setup

Which situation is an example of unsupervised learning at Maple Café?

Step 5 of 7

Learn from Actions and Rewards

Learn how reinforcement learning improves action choices through reward feedback, and how this differs from labels and unlabeled structure.

The delivery-cart idea

Actions, consequences, and rewards

Reinforcement learning: learn from consequences

In reinforcement learning, a model takes actions in an environment and receives a reward connected to the consequences of those actions.

At Maple Café, imagine a virtual delivery cart. The cart chooses a move, its situation changes, and it receives feedback. Across many attempts, training can adjust the model toward choices that lead to more desirable results.

A reward is not a supplied correct answer for one row of data. It signals how well a result fits a goal.

A reinforcement-learning loop

A left-to-right diagram of a Cart taking an action, reaching a Delivery point or an Obstacle, receiving a reward, and using feedback in repeated attempts.

The cart acts, the environment changes, and reward feedback can guide later adjustment.

What reward feedback means

One attempt is part of a longer process

Consider one attempt by the virtual cart:

  1. The Cart moves toward a Delivery point.
  2. Its position in the environment changes.
  3. Reaching the delivery point receives +1.

Another move might hit an Obstacle and receive -1. A move with neither outcome receives 0. Over repeated attempts, the aim is to improve action choices over time.

Sometimes the useful reward comes only after several actions. The reward still evaluates the consequence under the goal; it does not point to one correct action for every situation.

Example

Example: feedback after a sequence

Suppose the cart makes several moves around an obstacle before reaching the delivery point. The useful signal may be the later +1, rather than a label saying which individual move was “correct.” Training uses the reward experience to adjust future choices over repeated attempts.

Tip

Key distinction

Do not confuse a reward with a label. A label gives a target answer for an example, such as observed iced-drink sales. A reward says how desirable a consequence was for a goal, such as completing a delivery.

Compare learning setups

Three sources of learning signal

These learning setups differ mainly in what information guides learning.

Compare the feedback available

The learning setup determines whether training receives labels, structure alone, or rewards.
Learning setupWhat is availableWhat learning uses
Supervised learningFeatures and supplied labelsLabels guide adjustment
Unsupervised learningFeatures without target labelsStructure or similarities
Reinforcement learningActions, consequences, and rewardsRewards guide action choices

Practice: match setup to feedback

Identify the learning signal

Match each setup to the learning type and the information available for learning.

Tap an item and then its matching pair.

Step 6 of 7

A Pattern Is Not Proof of a Cause

Learn why an observed relationship can support a prediction without proving what caused the outcome.

Read the records carefully

A useful pattern is not a cause

Maple Café’s records show a pattern: days with umbrellas Open also had higher recorded iced-drink sales than the days with umbrellas Closed.

That relationship can be useful for prediction. A model can learn that these values occurred together in past examples.

But “occurred together” is not the same as “one caused the other.” The four records alone do not show that opening umbrellas causes more iced-drink sales.

Tip

Keep two questions separate:

  • Pattern question: What values tended to occur together in the records?
  • Cause question: Did changing one factor make the outcome change?

The café table can suggest an answer to the first question. By itself, it cannot settle the second.

Consider a possible shared influence

One factor can influence two observations

A third factor can offer another explanation. In this example, warmer weather could make Maple Café more likely to open umbrellas and could also increase demand for iced drinks.

This is a plausible explanation, not something proved by the small table. Other explanations may also be possible.

A branching diagram in which warmer weather points to both umbrellas being open and higher demand for iced drinks.

A possible shared influence: warmer weather could affect both umbrella status and iced-drink demand.

Do not turn a prediction into a causal claim

Prediction is not a what-if proof

A model prediction answers a question such as: “Given inputs like these, what sales value is likely?” It uses patterns it learned from records.

It does not answer this different question: “What would happen if Maple Café deliberately changed only umbrella status while everything else stayed the same?” A prediction alone cannot establish that result.

Example

Two different claims

The statement “umbrellas Open is linked with higher recorded sales” describes an observed pattern.

The statement “opening umbrellas increases sales” claims a cause. Treat that stronger claim cautiously unless there is additional evidence beyond these records.

Apply the distinction

Practice: state the limit

Rewrite this unsupported claim as a cautious statement about an observed pattern, then name one plausible alternative explanation:

“Opening umbrellas causes more iced-drink sales.”

Write at least 80 characters (0/80).

Step 7 of 7

Explain a Complete Learning Scenario

Apply the full Maple Café case: identify inputs and outcomes, separate inference from training, compare learning feedback, and avoid causal overclaims.

Follow the final café day

One day, four distinct events

Maple Café opens on a new day with these features: a forecast high of 24 °C and umbrellas Closed. At that moment, sales have not happened yet, so the label is unknown.

Prediction
22 drinks

Later, the café records what happened.

Observed label
20 drinks

All values in this case are illustrative. Recording the outcome creates a completed labeled example, but it does not automatically change the model.

Final café-day record

The same day can be shown before and after the outcome is known.

At opening, the label is unknown. Later, the recorded sales value becomes the observed label.
Forecast high (°C)UmbrellasIced drinks sold
24Closed?
24Closed20

From opening information to a later update

A left-to-right flow shows features leading to a prediction, then a later observed label feeding a later training adjustment.

Inference produces the prediction. Outcome collection records what happened. A separate later training event can use the completed example to adjust the model.

Tip

Keep the roles separate

A complete learning story separates these roles: inference applies a trained model to features; outcome collection records a later label; training is the separate process that uses examples or feedback to adjust a model. A prediction can be useful without proving why the outcome occurred.

Identify the available feedback

Compare three learning setups

Match each Maple Café setup to the feedback available for learning.

Tap an item and then its matching pair.

Separate use, collection, and adjustment

Check the event sequence

Which sequence correctly describes the final Maple Café day?

Explain the complete scenario

Final application

Using the final Maple Café case, write 4–6 sentences. Identify the two features and the observed label. Distinguish the prediction event, outcome collection, and later model adjustment. Then state the feedback available in supervised learning, unsupervised learning, and reinforcement learning. Finally, explain why the sales prediction cannot prove that opening umbrellas affects iced-drink sales.

Write at least 280 characters (0/280).

Step complete

Congratulations! You completed: How Models Learn from Data

Complete: you can explain a model-learning scenario from input to prediction, feedback, and its limits.

Download the App now to have access to + 5000 free courses, exercises, certificates and lots of content without paying anything!

  • 100% free online courses from start to finish

    Thousands of online courses in video, ebooks and audiobooks.

  • More than 60 thousand free exercises

    To test your knowledge during online courses

  • Valid free Digital Certificate with QR Code

    Generated directly from your cell phone's photo gallery and sent to your email

Cursa app on the ebook screen, the video course screen and the course exercises screen, plus the course completion certificate