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

Description Usage Arguments Value Examples

Description

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

Usage

1
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

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

Example output

Attaching package: 'MLmetrics'

The following object is masked from 'package:base':

    Recall

[1] 0.6582668

MLmetrics documentation built on May 2, 2019, 11:28 a.m.