Concepts 🚀 Project 🧮 Labs
🧮 Labs / Benchmark Engine / Regression metrics — MAE, MSE, RMSE, R²

Regression metrics — MAE, MSE, RMSE, R²

Compute the 4 standard regression metrics. Each tells you something different about model quality.

script.py v3.1
Python output click Run to execute
Click "Run" to execute the code on the left.
The output will appear here.
🧠 How it works

4 metrics, 4 questions: MAE (Mean Absolute Error) — 'on average, how far off?' Same units as target. Most interpretable. MSE (Mean Squared Error) — squares errors, so big errors count more. Units are target² (hard to interpret). RMSE (Root Mean Squared Error) — sqrt of MSE. Back in target units. Like MAE but punishes outliers. R² (R-squared) — 0 to 1. How much better than just predicting the mean. 1=perfect, 0=mean, <0=worse than mean. Rule of thumb: report MAE to non-technical people, R² in papers, RMSE when comparing models with outliers.

✏️ Try these changes
  • Change noise from 20 to 50 in make_regression
    → harder data → all metrics worse
  • Change n_estimators from 50 to 200
    → RF might improve slightly
  • Add from sklearn.svm import SVR; compute SVR metrics
    → compare 3 models
  • Change test_size from 0.2 to 0.4
    → bigger test set → more stable metrics