What clues would help you decide whether an email is spam? Its size, the day it arrived, and the words it contains could all help. Each such property is a feature: a characteristic of a data example that a model can use to make a prediction. A model might use one feature or combine several. section 1.3 section 8.2
In a table, each row usually represents one example and each feature occupies a column. The label is what you want to predict from the other columns. For a pet, type could be the label when predicting cat or dog; age could instead be the label when predicting age. A feature's role therefore depends on the question. section 2.1
Predict a house price from one feature
Suppose nearby houses cost $150 with one room, $200 with two, and $250 with three. The pattern adds $50 per room to a $100 base price: predicted price = 100 + 50 × number of rooms. For a four-room house, the prediction is $300. Here, room count is the input feature and price is the label. A fuller model could use size, location, and other properties too. section 3.2 section 3.1
Table 3.1 A table of houses with the number of rooms and prices. House 4 is the one whose price we are trying to infer. (view table figure)
| Number of rooms |
Price |
| 1 |
150 |
| 2 |
200 |
| 3 |
250 |
| 4 |
? |
| 5 |
350 |
| 6 |
400 |
| 7 |
450 |
Compare the room counts and prices, then try filling in the missing price before using the formula. section 3.2
Features need not be numbers at first. Age and fare are numerical; categories such as gender or boarding location are categorical. One-hot encoding turns categories into numerical columns, while binning can turn an age into a range. Feature selection removes columns judged unnecessary. These choices shape the inputs the model receives. section 13.3 section 13.7
Different models use features differently. A decision tree can ask whether a user is below an age cutoff and compare that split with one based on phone platform. A spam model can use the presence of words to estimate the probability of spam. After preparing a dataset, separate its features from its labels, then use training, validation, and test data to assess predictions. Try choosing a label in a small table and asking which remaining columns might help predict it. section 9.2 section 9.3 section 13.4













