R2_Score: R-Squared (Coefficient of Determination) Regression Score

View source: R/Regression.R

R2_ScoreR Documentation

R-Squared (Coefficient of Determination) Regression Score

Description

Compute the R-Squared (Coefficient of Determination) Regression Score.

Usage

R2_Score(y_pred, y_true)

Arguments

y_pred

Estimated target values vector

y_true

Ground truth (correct) target values vector

Value

R^2 Score

Examples

data(cars)
reg <- lm(log(dist) ~ log(speed), data = cars)
R2_Score(y_pred = exp(reg$fitted.values), y_true = cars$dist)

MLmetrics documentation built on May 29, 2024, 9:34 a.m.