Intermediate
Open
Pro
Standardisation, Intercept and Pipeline Placement
A junior data scientist fits Lasso(alpha=0.1) on a house-price dataset
with these raw features: sqft (500–5000), bedrooms (1–6),
lot_acres (0.05–2.0), year_built (1900–2020). The target is price in
dollars. They report that lasso "selected sqft and year_built and
dropped bedrooms and lot_acres", and that the intercept came out
very close to zero, which they find suspicious.
- Why is the feature-selection conclusion untrustworthy as stated? What should they have done, and how would you expect the result to change?
- Should the intercept be penalised? What would happen if a hand-written implementation did penalise it, given the target is house price in dollars?
- They fix the scaling by calling
StandardScaler().fit_transform(X)on the full dataset before runningcross_val_scoreon the lasso. Is there still a problem?
Share this question