A linear regression model predicts monthly rent, in thousands of rupees, as y^=5+0.02 a+3 r, where a is the flat's area in square feet and r 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 y^=b0+b1x1+b2x2, 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 b0 is the prediction when all features are 0.

Steps

  1. Substitute for (a): y^=5+0.02×600+3×2.
  2. Compute each part: 0.02×600=12 and 3×2=6, so y^=5+12+6=23, that is 23 thousand rupees.
  3. Read (b): the coefficient 3 says each extra bedroom adds 3 thousand rupees to the predicted rent, if the area stays the same.
  4. Do (c): the bedroom count is the same, so only the area term changes: 0.02×100=2. The larger flat is predicted to cost 2 thousand rupees more.
  5. Add a caution. These are the model's predictions, not causal facts: it describes the pattern in its training data.

Common mistakes

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, −ψ(yi−c) where ψ(r)=max⁡(−δ,min⁡(δ,r)), so the optimal constant fit c satisfies ∑iψ(yi−c)=0. When fitting a constant c to {1,2,3,4,100}, what does squared loss give, verify that c=3 satisfies the Huber condition for δ=1.5, and compare it with the mean and median?
Next in Supervised learning: Two weight vectors fit a training set equally well: wA=(3,0) and wB=(1.5,1.5). Ridge adds the penalty λ∑jwj2 and lasso adds λ∑j∣wj∣, with λ=0.1. Compute both penalties for each vector. Which vector does each method prefer?