Definition
What clues tell an apple from an orange, even with your eyes closed?
In machine learning, an example is one item the model learns from. Its label is the correct answer, such as 'apple' or 'orange'. Its features are the measurable clues the model uses to decide, such as colour, weight or how smooth the skin is.
In simple words
Think of a table. Each row is one fruit (an example). The last column says what it really is (the label). The other columns are clues: colour, weight, skin (features). Good features make the job easy: skin texture separates apples from oranges well. Bad features don't help: both can weigh the same.
Why it matters
Choosing good features is one of the most important decisions in building a model. If the clues don't separate the answers, no amount of training will help.
How it works
| Colour | Weight (g) | Skin | Label |
|---|---|---|---|
| Red | 150 | Smooth | Apple |
| Orange | 160 | Bumpy | Orange |
| Green | 140 | Smooth | Apple |
| Orange | 150 | Bumpy | Orange |
Here weight is a poor feature, because apples and oranges weigh about the same. Skin is an excellent feature: smooth means apple, bumpy means orange.
Try it yourself
Pull one example apart
An apple and an orange: what does the model actually see?
Label or feature?
A model predicts whether a student will enjoy a book. Is each item a feature or the label?
Number of pages
Type of book: adventure, mystery, science
Did the student enjoy it? Yes or no
Has pictures or not
Choose the clues that separate apples from oranges
Would each feature help a model tell them apart?
Skin texture: smooth or bumpy
Price
Smell
The day it was bought
Weight
Common mistakes
- Mixing up the label and the features. The label is the answer; features are the clues.
- Using features that have nothing to do with the answer.
- Using a feature that secretly contains the answer, which makes the model look better than it is.
Check yourself
Summary
- An example is one item; its label is the right answer.
- Features are measurable clues the model uses.
- Good features separate the answers; poor ones don't help.
Finished reading?
Sources: Google Machine Learning Crash Course