Chapter 2 · Machine learning basics
Data and features
Machine learning sees the world as features: measurable columns that describe each example.
Chapter 2 · Machine learning basics
Machine learning sees the world as features: measurable columns that describe each example.
| Fruit | Redness (0–10) | Length (cm) | Weight (g) |
|---|---|---|---|
| Apple | ? | ? | ? |
| Banana | ? | ? | ? |
A computer cannot look at a fruit. We measure it, and the measurements become numbers in a table. Each column is a feature.
One fruit, one house, one photo. Each example is a single row in a table of data.
Tick the columns the model may use. It learns from 12 houses, then is scored on 12 houses it has never seen. Prices are in lakh rupees.
| House | Size (m²) | Bedrooms | Age (years) | Distance to metro (km) | Door colour (1–6) | House number | Actual | Guess |
|---|---|---|---|---|---|---|---|---|
| #2 | 71 | 2 | 22 | 2.6 | 1 | 76 | 38 | 38 |
| #4 | 142 | 3 | 4 | 1.7 | 2 | 55 | 95 | 79 |
| #6 | 146 | 4 | 1 | 1.9 | 3 | 43 | 94 | 82 |
| #8 | 121 | 2 | 11 | 1.5 | 1 | 91 | 76 | 67 |
| #10 | 136 | 3 | 28 | 1.4 | 4 | 65 | 79 | 76 |
Strong features. Notice that size, age and distance do the real work. This is a teaching version: a straight-line model on invented houses.
In a table of houses, what is a feature?
Which feature will probably help least when predicting a house price?
Why must photos or fruit become numbers first?