R/computation.R
r_square.Rd
Coefficient of determination (\(R^2\))
r_square(y_true, y_pred)
A numeric vector with ground truth values.
A numeric vector with predicted values.
The \(R^2\) value.
y <- rnorm(100) y_pred <- y + rnorm(100, sd = 0.5) r_square(y, y_pred) #> [1] 0.7778111