Robots Atlas>ROBOTS ATLAS

Machine Learning · Regression

Metrics and scikit-learn in practice

Regression

Introduction

Choosing a metric is a product decision, not just a technical one — MAE treats all errors linearly, MSE/RMSE penalize large deviations quadratically, R^2 shows the fraction of explained variance, MAPE gives a percentage result but blows up when y is near zero. In this lesson we combine theory with the scikit-learn API: LinearRegression, Ridge, Lasso, SGDRegressor, the Pipeline class (StandardScaler + estimator), train_test_split, cross_val_score, learning_curve, mean_absolute_error / mean_squared_error / r2_score / mean_absolute_percentage_error and residual analysis (residual plot, Q-Q plot). Goal: after this lesson you can build, train, evaluate and diagnose a regression model in 30 lines of sklearn code.