Principle:Scikit learn Scikit learn Regression Metrics
| Knowledge Sources | |
|---|---|
| Domains | Model Evaluation, Regression |
| Last Updated | 2026-02-08 15:00 GMT |
Overview
Regression metrics quantify the discrepancy between predicted continuous values and actual observed values, providing a numerical assessment of model accuracy.
Description
Regression metrics measure how well a model's continuous predictions match the true target values. Different metrics emphasize different aspects of prediction error: some penalize large errors more heavily, some are scale-independent, and some measure the proportion of variance explained. Choosing the right metric ensures that model evaluation aligns with the practical consequences of prediction errors. Regression metrics are fundamental to model selection, hyperparameter tuning, and reporting in any regression task.
Usage
Use Mean Squared Error (MSE) or Root Mean Squared Error (RMSE) when large errors are particularly undesirable, as squaring amplifies their contribution. Use Mean Absolute Error (MAE) when all errors should be weighted equally regardless of magnitude, or when robustness to outliers is desired. Use R-squared (coefficient of determination) to express the proportion of variance explained by the model, facilitating comparison across different scales. Use Mean Absolute Percentage Error (MAPE) when a scale-independent, relative error measure is needed. Use explained variance when the model may have a non-zero mean bias.
Theoretical Basis
Mean Squared Error (MSE):
Root Mean Squared Error (RMSE):
Mean Absolute Error (MAE):
R-squared (Coefficient of Determination):
indicates perfect prediction, indicates performance equal to predicting the mean, and indicates worse-than-mean predictions.
Explained Variance Score:
This differs from in that it does not account for systematic bias in predictions.
Mean Absolute Percentage Error (MAPE):
Max Error:
This captures the worst-case prediction error, useful for safety-critical applications.
Median Absolute Error (MedAE):
This is robust to outliers, as the median is unaffected by extreme values.