Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Rapidsai Cuml Regression Evaluation

From Leeroopedia


Knowledge Sources
Domains Machine_Learning, Regression, Evaluation
Last Updated 2026-02-08 12:00 GMT

Overview

Regression evaluation is the quantitative assessment of continuous-valued prediction quality using error metrics such as Mean Squared Error, Root Mean Squared Error, Mean Absolute Error, and the coefficient of determination (R-squared) to measure how closely predicted values match observed values.

Description

Regression models produce continuous-valued predictions, and evaluating their quality requires metrics that quantify the discrepancy between predicted values and the true target values. Unlike classification where correctness is binary, regression errors exist on a continuous scale, and different metrics emphasize different aspects of prediction quality.

Mean Squared Error (MSE): The average of the squared differences between predictions and true values. Squaring the errors penalizes large errors disproportionately, making MSE sensitive to outliers. MSE is always non-negative, with zero indicating perfect prediction. It is the most commonly used regression loss and is directly optimized by least-squares methods.

Root Mean Squared Error (RMSE): The square root of MSE. RMSE has the same units as the target variable, making it more interpretable than MSE. It represents the standard deviation of the prediction residuals under the assumption of unbiased predictions.

Mean Absolute Error (MAE): The average of the absolute differences between predictions and true values. MAE weights all errors equally regardless of magnitude, making it more robust to outliers than MSE. MAE corresponds to the median-optimal predictor, whereas MSE corresponds to the mean-optimal predictor.

R-squared (Coefficient of Determination): Measures the proportion of variance in the target variable that is explained by the model. R-squared compares the model's prediction error to the variance of a naive baseline that always predicts the mean of the target. A value of 1.0 indicates perfect prediction; 0.0 indicates the model is no better than predicting the mean; negative values indicate the model is worse than the mean baseline.

Usage

Regression evaluation metrics are used when:

  • Comparing the predictive accuracy of different regression models on the same dataset.
  • Performing hyperparameter tuning by selecting the model that minimizes a chosen error metric.
  • Monitoring model performance over time to detect degradation.
  • Communicating model quality to stakeholders in interpretable terms (RMSE in the same units as the target, or R-squared as a proportion of explained variance).
  • Deciding between models that trade off different error characteristics: use MAE when outlier robustness is important, use MSE/RMSE when large errors should be heavily penalized, use R-squared for a scale-independent summary.

Theoretical Basis

Mean Squared Error:

MSE=1ni=1n(yiy^i)2

Root Mean Squared Error:

RMSE=1ni=1n(yiy^i)2=MSE

Mean Absolute Error:

MAE=1ni=1n|yiy^i|

R-squared (Coefficient of Determination):

R2=1i=1n(yiy^i)2i=1n(yiy¯)2=1SSresSStot

where y¯=1ni=1nyi is the mean of the true values, SSres is the residual sum of squares, and SStot is the total sum of squares.

GPU Computation:

Given arrays y_true and y_pred of length n on GPU:

MSE:
    residuals = y_true - y_pred                 (element-wise, GPU parallel)
    mse = sum(residuals^2) / n                  (GPU reduction)

RMSE:
    rmse = sqrt(mse)

MAE:
    mae = sum(abs(residuals)) / n               (GPU reduction)

R-squared:
    y_mean = sum(y_true) / n                    (GPU reduction)
    ss_res = sum((y_true - y_pred)^2)           (GPU reduction)
    ss_tot = sum((y_true - y_mean)^2)           (GPU reduction)
    r2 = 1 - ss_res / ss_tot

Relationships Between Metrics:

RMSE >= MAE (always, by Jensen's inequality)
RMSE = MAE when all errors have equal magnitude
R^2 = 1 - (n * MSE) / SS_tot
R^2 can be negative when MSE > Var(y)

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment