Regression practice problems

18 problems · 0 solved

Regression predicts a number, or a probability, from input features. Linear regression fits the best straight line through the data, and many other models extend that idea with different losses, penalties or link functions. Regression is often the first model you should try, because it is fast, easy to explain and a strong baseline. These problems cover both closed-form fits and iterative training. You will fit linear regression with the normal equation, fit a polynomial by expanding features, fit weighted least squares, stop overfitting with ridge, compute the elastic net penalty, fit Lasso with coordinate descent and soft thresholding, train logistic and softmax regression with gradient steps, resist outliers with the Huber loss, compute the quantile loss, fit Poisson regression with Newton steps, and compute the Bayesian linear regression posterior. Start with the Easy problems on the normal equation and polynomial features. Then do ridge, logistic and robust losses, and finish with Lasso, Poisson and the Bayesian posterior. Regression questions are a staple of data science and ML interviews, and in many business problems a well tuned regression is what actually goes to production.

Easy 3

Medium 7

Hard 8

Related topics

All practice problems