powered by
coefficient of determination (\(R^2\))
r_square(y_true, y_pred)
\(R^2\) value
A numeric vector with ground truth values.
A numeric vector with predicted values.
y <- rnorm(100) y_pred <- y + rnorm(100, sd = 0.5) r_square(y, y_pred)
Run the code above in your browser using DataLab