📅  最后修改于: 2022-03-11 14:52:00.738000             🧑  作者: Mango
library(caret)
# datasets:
original = c( -2, 1, -3, 2, 3, 5, 4, 6, 5, 6, 7)
predicted = c(-1, -1, -2, 2, 3, 4, 4, 5, 5, 7, 7)
# caret package functions
RMSE(predicted, original)
R2(predicted, original, form = "traditional")
[1] 0.904534