powered by
Compute the R-squared value between predicted and actual values.
pred.R2(y_true, y_pred)
The R-squared value.
Actual values.
Predicted values.
y_true <- c(1, 2, 3, 4, 5) y_pred <- c(1.1, 2.2, 2.9, 4.1, 4.8) pred.R2(y_true, y_pred)
Run the code above in your browser using DataLab