← Machine Learning for EveryoneToolsInVisionLearning Center
Problem and Data · Lesson 1

Turn a Real Problem into a Learning Task

A delivery dispatcher wants fewer late arrivals.

Watch the lesson

Turn a Real Problem into a Learning Task explained visually

1:41

A delivery dispatcher wants fewer late arrivals. English captions are optional and start off. The complete transcript follows the written lesson.

Lesson overview

What you will learn

A delivery dispatcher wants fewer late arrivals.

  1. The delivery decision
  2. Define the output
  3. Available inputs
  4. Compare and refine
01

The delivery decision

A dispatcher wants to prevent late deliveries. “Use machine learning to fix delays” sounds useful, but what should a prediction actually say? And when will someone use it? Let's define the task before choosing a model.

02

Define the output

The dispatcher must decide before a driver leaves. We could predict the number of minutes late; that is a regression task. Or we could predict whether the delivery will be more than ten minutes late; that is classification. For this example, let's choose the second answer, because the dispatcher can review trips likely to miss that limit.

03

Available inputs

Now consider the inputs. The planned route, departure time, distance, and a forecast available before departure might help. The actual arrival time cannot be an input: it is only known after the trip. Training with that future answer would make a model look impressive in a test while making it unusable at decision time. That mistake is called information leakage.

04

Compare and refine

We also need a simple comparison. A baseline could flag routes that were often late in the past. Our new model should improve on that baseline using deliveries it did not train on. Before we start, we should agree on the label and the cost of a missed delay versus an unnecessary warning. Now we have a clear task: predict a delay greater than ten minutes, before departure, using information available then. Next, we'll split past deliveries to test that idea honestly.

Worked example

If dispatchers choose a route before departure, a feature recording the actual arrival time is unavailable at prediction time. Including it would create an unrealistically easy training problem. Use only information that the deployed system could genuinely know when making the prediction.

Knowledge check

Quick check: test your understanding

Try it yourself: Define a prediction target, prediction time, and three available features for estimating package delivery delay.

Check the reasoning

One valid target is delay in minutes, predicted before departure using planned route length, scheduled departure time, and weather information available then.

Is a yes-or-no ten-minute delay target regression or classification?

Classification; the output is one of two categories.

Why exclude actual arrival time from predeparture inputs?

It is known only after departure and would leak the answer.

Why use a simple route-based baseline?

It provides a comparison on unseen deliveries to check that the new model adds value.

Further reading

Machine Learning — Tom M. Mitchell.

Original ToolsInVision teaching examples. Editorial approach · Suggest a correction

Accessible referenceLesson 1 transcript235 words · Video transcript · Matches the published narration and captionsOpen transcript

A dispatcher wants to prevent late deliveries. “Use machine learning to fix delays” sounds useful, but what should a prediction actually say? And when will someone use it? Let's define the task before choosing a model.

The dispatcher must decide before a driver leaves. We could predict the number of minutes late; that is a regression task. Or we could predict whether the delivery will be more than ten minutes late; that is classification. For this example, let's choose the second answer, because the dispatcher can review trips likely to miss that limit.

Now consider the inputs. The planned route, departure time, distance, and a forecast available before departure might help. The actual arrival time cannot be an input: it is only known after the trip. Training with that future answer would make a model look impressive in a test while making it unusable at decision time. That mistake is called information leakage.

We also need a simple comparison. A baseline could flag routes that were often late in the past. Our new model should improve on that baseline using deliveries it did not train on. Before we start, we should agree on the label and the cost of a missed delay versus an unnecessary warning. Now we have a clear task: predict a delay greater than ten minutes, before departure, using information available then. Next, we'll split past deliveries to test that idea honestly.