Dummy coefficient as a contrast: fit OLS on a two-level plan dummy and return its coefficient
Role: Data Scientist
Category: Machine Learning
Difficulty: easy
Interview Round: Other
Overview: Fit an OLS regression of an outcome on one 0/1 plan dummy with an intercept and return the dummy's coefficient as a Python float. It tests dummy encoding with a reference level, the meaning of the intercept and slope, and the pitfalls of missing levels and the dummy variable trap.