Level 2 · Module 5 · 10 minutes
Features, labels and the question you are asking
- Define feature and label using a concrete example.
- Explain why a label needs a precise definition.
- Spot a feature that would not be available at decision time.
Supervised learning needs two parts: the information you will have when making a decision, and the answer you want to predict. The information is called the features. The answer is called the label. Getting these two clear is most of the work.
An example: late deliveries
A delivery company wants to warn customers when an order is likely to arrive late. For each past order, the features might be the distance to the address, the number of items, the time the order was placed, the courier shift, and whether the address is in a busy area. The label is whether that order actually arrived late.
During training, the software sees the features and the label together. It learns which combinations tend to appear with lateness. Later, for a new order, only the features are available, and the model predicts the label.
The label must be defined precisely
Late sounds obvious until you write it down. Late compared with what: the promised window, the average, or the customer's expectation? Does a delivery a few minutes after the window count? Whose clock decides? If two people labelling the same orders would disagree, the model learns a confused target. A precise definition, written down and applied consistently, matters more than a clever algorithm.
Features must be available at decision time
This is a common and expensive mistake. Suppose you include the number of complaint calls made after delivery as a feature. At the moment you predict, that information does not exist yet. In training it looks like a brilliant signal, because complaints follow late deliveries. In use the field is empty, and the model is useless.
The test is simple: for every feature, ask whether you would really know this when the decision is made. If the answer is no, the feature belongs in the label or nowhere.
Labels are not always present
Some problems have no answer column. A shop may want to group products that are often bought together, without anyone having decided the groups in advance. That is unsupervised learning: features only, no label. It is covered later in the course.
Writing labels on cards
In a workshop, labelling sample records by hand teaches how a label definition is applied and where it becomes ambiguous. It is a useful rehearsal of a real task. It is not training, because no model exists until software compares many labelled examples and adjusts its internal numbers. The humans produce the answers, and the software would do the learning.
Common misconception
Any column in the dataset is a useful feature for predicting the answer. A feature must be known at the moment of prediction and must not contain the answer. Columns recorded only after the outcome, or columns that directly encode it, create leakage and make results look better than they are.
Guided practice
Choose a decision you would like to predict, such as whether an order arrives late or whether a student passes a test. List the features you would know at decision time, write the label definition in one sentence, and list a feature you would not know yet. Explain in one sentence why the last list must not be used.
Knowledge check
Independent practice
Write a short example from your own work or daily life and decide whether it is AI, ordinary software or a mixture. Then explain why. Save it in your notes; no account is required.
Last reviewed: · Report a problem