Week 2 · Lesson 1 · 45-55 minutes
Examples, Labels, and Features
Open up a dataset and meet its building blocks: each example, the label that says which category it belongs to, and the features that describe it.
- Materials
- This lesson in a web browser · Paper and pencil, or a notes app · The built-in fruit dataset shown in this lesson
- This lesson
- In progress
Auto-saves on this device
What you'll be able to do
- Name the parts of a dataset: examples, labels, and features.
- Read a data table and point to one example, its features, and its label.
- Explain how features and labels help a model learn a pattern for a category.
Think about it
Imagine a table where each row is one fruit. The columns say its color, its weight, and its shape — and the last column says what the fruit is. If you covered up that last column, could you still guess each fruit? What would you look at?
Keep your answer in mind — this lesson names every part of that table.
Make a prediction
Predict: which one piece of information in the fruit table is the 'answer' the model is trying to learn, and which pieces are the clues?
Vocabulary
See the full course vocabulary- Dataset
- A collection of examples gathered together for a model to learn from, often shown as a table of rows and columns.
- Example
- One item in a dataset — usually one row — like a single fruit, photo, or message.
- Label
- The correct answer attached to an example, telling which category it belongs to, such as 'apple' or 'banana'.
- Feature
- A piece of information that describes an example, like its color, weight, or shape. Each feature is usually a column in the table.
- Category
- One of the groups a model sorts examples into. The labels come from the list of categories.
- Pattern
- A regularity in the features that tends to go with a category, like 'long and yellow usually means banana'.
A dataset is a table of examples
A dataset is a collection of examples that a model learns from. The easiest way to picture it is a table: each row is one example, and each column holds one kind of information about that example.
If the dataset is about fruit, one row might be a single banana. If it is about email, one row is one message. The whole point of a dataset is to gather many examples in one place so a model can find patterns across them.
- A table with one row per fruit and columns for color, weight, and shape
- A table with one row per email and a column saying 'spam' or 'not spam'
- A table with one row per photo and a column naming the animal in it
Features describe; labels answer
In each example, the features are the descriptions — the clues. In the fruit table, color, weight, and shape are features. Features are usually the columns that tell you what an example is like.
The label is the correct answer for that example: the category it belongs to. For a banana, the label is 'banana'. Features and labels play different jobs: features are the clues you look at, and the label is the answer you are trying to match.
- Features of a fruit: color = yellow, shape = long, weight = 120 grams
- Label of that fruit: banana
- Features of an email: many links, the word 'free'; Label: spam
Categories and the patterns that fit them
A category is one of the groups you can sort examples into. If a dataset only has apples and bananas, then 'apple' and 'banana' are the two categories, and every label is one of them.
A model learns by finding a pattern: a way the features tend to line up with a category. From many labeled fruits it may learn 'long and yellow usually means banana' and 'round and red usually means apple'. Later it can use that pattern to label a new fruit it has never seen, just from its features.
- Categories: apple, banana
- Pattern learned: round + red → apple; long + yellow → banana
- New fruit with features round and red → the model predicts 'apple'
Worked example
Reading one row of the fruit dataset
- Look at one row: color = yellow, shape = long, weight = 120 grams, fruit = banana.
- Find the example: this whole row is one example — a single fruit.
- Find the features: color, shape, and weight are the features that describe it.
- Find the label: 'banana' is the label — the correct category for this example.
- Notice the pattern forming: rows labeled banana keep showing 'yellow' and 'long', so those features become clues for the banana category.
Takeaway: Every example is a row; its features are the describing columns, and its label is the answer column.
| Color | Weight (g) | Shape | Fruit (label) |
|---|---|---|---|
| Red | 150 | Round | Apple |
| Yellow | 120 | Long | Banana |
| Green | 160 | Round | Apple |
| Yellow | 115 | Long | Banana |
A small dataset table. Each row is one example fruit. The Color, Weight, and Shape columns are features. The last column, Fruit, is the label — the category for that example. Row 1: red, 150 grams, round, apple. Row 2: yellow, 120 grams, long, banana. Row 3: green, 160 grams, round, apple. Row 4: yellow, 115 grams, long, banana.
The first three columns are features; the last column is the label.
A diagram of a single dataset row. An arrow points to the whole row labeled 'Example'. Three cells (color, weight, shape) are grouped and labeled 'Features — the clues'. One cell at the end (fruit) is labeled 'Label — the answer'. A note reads 'The label names the category this example belongs to.'
Features are the clues that describe an example; the label is its category.
Activity
Dataset Labeling Workspace
Inspect a built-in space-fruit dataset, assign a Safe or Not-safe label to each example using only its features, and hunt down duplicates and missing values.
- Inspect each space fruit's features in the table.
- Assign a label — Safe or Not safe — to as many as you can. Watch for duplicate rows and missing values.
- Use the filter and sort controls to investigate. Then check your labels against the answer key.
Dataset at a glance
- Total examples: 14
- Your labels — Safe: 0, Not safe: 0, left to do: 14
- Duplicate rows found: 4 · Missing values: 2
Count by texture
Count by texture: smooth: 5, bumpy: 3, fuzzy: 3, spiky: 3.
Heads up before you trust this data:
- 4 rows are duplicates (same features as another row). Counting a fruit twice over-weights it.
- 2 rows have a missing feature value, shown as “—”. A missing value can make a fruit hard to label.
- Remember: two fruits that are merely similar are not duplicates — only rows with identical features are.
Showing 14 of 14
| Fruit | Color | Shape | Texture | Grows in | Seeds | Sweetness | Glow level | Size | Your label |
|---|---|---|---|---|---|---|---|---|---|
| Barbcone | azure | star | spiky | cavern | 3 | 2 | 2 | 5 cm | |
| Craterspine | violet | star | spiky | crater | 2 | 3 | 4 | 5 cm | |
| DawnberryDuplicate of Dawnberry twin | crimson | round | smooth | canopy | 6 | 8 | 0 | 10 cm | |
| Dawnberry twinDuplicate of Dawnberry | crimson | round | smooth | canopy | 6 | 8 | 0 | 10 cm | |
| Deepcoil | azure | spiral | bumpy | cavern | 1 | 2 | 5 | 4 cm | |
| DunedropMissing texture | amber | round | — | dune | 3 | 7 | 1 | 7 cm | |
| Palestar | violet | star | smooth | crater | 1 | 4 | 3 | 6 cm | |
| RosedropMissing sweetness | crimson | oval | smooth | dune | 5 | — | 1 | 9 cm | |
| Sandplum | amber | oval | bumpy | dune | 4 | 7 | 1 | 8 cm | |
| Softamber | amber | round | fuzzy | canopy | 3 | 7 | 2 | 7 cm | |
| Spikecoil | violet | spiral | spiky | crater | 1 | 3 | 1 | 4 cm | |
| Sweetreef | teal | oval | smooth | reef | 6 | 9 | 0 | 10 cm | |
| TidefruitDuplicate of Tidefruit (copy) | teal | round | fuzzy | reef | 8 | 9 | 0 | 12 cm | |
| Tidefruit (copy)Duplicate of Tidefruit | teal | round | fuzzy | reef | 8 | 9 | 0 | 12 cm |
Barbcone
- Color
- azure
- Shape
- star
- Texture
- spiky
- Grows in
- cavern
- Seeds
- 3
- Sweetness
- 2
- Glow level
- 2
- Size
- 5 cm
Craterspine
- Color
- violet
- Shape
- star
- Texture
- spiky
- Grows in
- crater
- Seeds
- 2
- Sweetness
- 3
- Glow level
- 4
- Size
- 5 cm
Dawnberry
Duplicate of Dawnberry twin- Color
- crimson
- Shape
- round
- Texture
- smooth
- Grows in
- canopy
- Seeds
- 6
- Sweetness
- 8
- Glow level
- 0
- Size
- 10 cm
Dawnberry twin
Duplicate of Dawnberry- Color
- crimson
- Shape
- round
- Texture
- smooth
- Grows in
- canopy
- Seeds
- 6
- Sweetness
- 8
- Glow level
- 0
- Size
- 10 cm
Deepcoil
- Color
- azure
- Shape
- spiral
- Texture
- bumpy
- Grows in
- cavern
- Seeds
- 1
- Sweetness
- 2
- Glow level
- 5
- Size
- 4 cm
Dunedrop
Missing texture- Color
- amber
- Shape
- round
- Texture
- —
- Grows in
- dune
- Seeds
- 3
- Sweetness
- 7
- Glow level
- 1
- Size
- 7 cm
Palestar
- Color
- violet
- Shape
- star
- Texture
- smooth
- Grows in
- crater
- Seeds
- 1
- Sweetness
- 4
- Glow level
- 3
- Size
- 6 cm
Rosedrop
Missing sweetness- Color
- crimson
- Shape
- oval
- Texture
- smooth
- Grows in
- dune
- Seeds
- 5
- Sweetness
- —
- Glow level
- 1
- Size
- 9 cm
Sandplum
- Color
- amber
- Shape
- oval
- Texture
- bumpy
- Grows in
- dune
- Seeds
- 4
- Sweetness
- 7
- Glow level
- 1
- Size
- 8 cm
Softamber
- Color
- amber
- Shape
- round
- Texture
- fuzzy
- Grows in
- canopy
- Seeds
- 3
- Sweetness
- 7
- Glow level
- 2
- Size
- 7 cm
Spikecoil
- Color
- violet
- Shape
- spiral
- Texture
- spiky
- Grows in
- crater
- Seeds
- 1
- Sweetness
- 3
- Glow level
- 1
- Size
- 4 cm
Sweetreef
- Color
- teal
- Shape
- oval
- Texture
- smooth
- Grows in
- reef
- Seeds
- 6
- Sweetness
- 9
- Glow level
- 0
- Size
- 10 cm
Tidefruit
Duplicate of Tidefruit (copy)- Color
- teal
- Shape
- round
- Texture
- fuzzy
- Grows in
- reef
- Seeds
- 8
- Sweetness
- 9
- Glow level
- 0
- Size
- 12 cm
Tidefruit (copy)
Duplicate of Tidefruit- Color
- teal
- Shape
- round
- Texture
- fuzzy
- Grows in
- reef
- Seeds
- 8
- Sweetness
- 9
- Glow level
- 0
- Size
- 12 cm
Label a few fruits first. The answer key stays hidden until you choose to check — investigate before you reveal.
Check your understanding
Answer these to check that you can name the parts of a dataset.
Question 1. In the fruit table, the column that says 'apple' or 'banana' is the…
Question 2. Which of these are features in a fruit dataset? Choose all that apply.
Select all that apply.
Question 3. Decide if the statement is true or false.
One example in a dataset is usually a single row in the table.
0 of 3 answered
Try it yourself
Design your own tiny dataset
Invent a small dataset for a category you know well, like 'dog or cat' or 'weekday or weekend'.
- Choose two categories and write them down as your labels.
- Pick three features that would help tell the categories apart.
- Make a table with five example rows, filling in the features and the correct label for each.
Success looks like
- Two clear categories used as labels.
- Three sensible features chosen.
- Five example rows, each with features and a correct label.
Reflection
Saved on this device as you type
Please don't include private information. Your answers are saved only in this browser and are never sent anywhere.
Recap
A dataset is a table of examples; each example has features that describe it and a label naming its category, and models learn patterns that link features to categories.
- One example is one row; features are the describing columns and the label is the answer column.
- Categories are the groups; every label is one of the categories.
- A model learns patterns that connect features to a category.
Grades 7–8 extension
Which features actually matter?
Not every feature is helpful. In the fruit table, 'shape' and 'color' separate apples from bananas well, but a feature like 'day the fruit was picked' probably tells the model nothing useful.
Look at your own tiny dataset. Which feature does the most work to separate the categories, and is there a feature you could remove without hurting the pattern? Explain your reasoning.
Finish this lesson
- Attempt the knowledge check — not done
- Save a reflection (recommended) — not done
Attempt the knowledge check to finish this lesson.