A linear regression model predicts monthly rent, in thousands of rupees, as , where is the flat's area in square feet and is the number of bedrooms. (a) What rent does it predict for a 600 sq ft flat with 2 bedrooms? (b) What does the number 3 mean? (c) Two flats both have 2 bedrooms but one is 100 sq ft larger. How much more rent does the model predict for it?
Supervised learning, Linear regression
Level L2 Elementary. Length Short. Nature Th+Mat Both.
What's being asked
Whether you can use a fitted linear model with several features and read each coefficient as an effect with the other features held fixed.
Key idea
In , each coefficient is the change in the prediction when its feature goes up by one unit while the other features stay the same. The constant is the prediction when all features are 0.
Steps
- Substitute for (a): .
- Compute each part: and , so , that is 23 thousand rupees.
- Read (b): the coefficient 3 says each extra bedroom adds 3 thousand rupees to the predicted rent, if the area stays the same.
- Do (c): the bedroom count is the same, so only the area term changes: . The larger flat is predicted to cost 2 thousand rupees more.
- Add a caution. These are the model's predictions, not causal facts: it describes the pattern in its training data.
Common mistakes
- Forgetting "other features held fixed". The effect of area is read at a fixed number of bedrooms.
- Reading the constant 5 as the rent of a typical flat. It is the prediction only for a flat with area 0 and 0 bedrooms, which is outside the data.
How long your answer should be
About 2 minutes: one prediction and two short readings.
Read this
Previous in Supervised learning: The Huber loss with threshold has derivative equal to minus the clipped residual, where , so the optimal constant fit satisfies . When fitting a constant to , what does squared loss give, verify that satisfies the Huber condition for , and compare it with the mean and median?
Next in Supervised learning: Two weight vectors fit a training set equally well: and . Ridge adds the penalty and lasso adds , with . Compute both penalties for each vector. Which vector does each method prefer?