R/utils.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.
\(R^2\) value
y <- rnorm(100) y_pred <- y + rnorm(100, sd = 0.5) r_square(y, y_pred) #> [1] 0.7681726