A dataset
-
Rows
- Each row is one example (record or instance)
- One mango, one loan application, one email
-
Features
- The columns the model uses as inputs
-
Label
- The column holding the answer to predict
- Also called the target
| Mango | Weight (g) | Colour score (1-10) | Softness (1-5) | Ripe? (label) |
|---|---|---|---|---|
| 1 | 250 | 8 | 4 | Yes |
| 2 | 180 | 3 | 1 | No |
| 3 | 230 | 7 | 4 | Yes |
| 4 | 210 | 4 | 2 | No |
| Type | What it looks like | Examples |
|---|---|---|
| Numerical | Numbers that can be measured or counted | Weight in grams, monthly rent, number of rooms |
| Categorical | Names of groups with no order | State, blood group, payment mode (UPI, cash, card) |
| Ordinal | Categories with a natural order | Small, medium, large; class 8, class 10, class 12 |
| Unstructured | Not in neat columns | Photos, voice recordings, free text such as complaints |
Cleaning data before learning
- Remove duplicates The same entry twice would count double.
- Fix wrong values Impossible or inconsistent values, such as an age of 205.
- Handle missing values Drop the row, or fill the gap with the mean, median or most common value.
- Check the labels A wrong label teaches the wrong lesson.
- Record every change So the same cleaning can be repeated on new data.
Garbage in, garbage out: a model can be no better than the data it learns from.
Key takeaways: a row is an example, the inputs are features and the answer is the label. Categories are converted to numbers, usually by one-hot encoding, and ordinal data keeps its order. Clean data before learning: remove duplicates, fix errors, handle missing values and check labels. The median is a safer fill than the mean when extreme values exist. Data that is wrong or unrepresentative produces a model that is wrong or unfair.