我添加了 r2 值和回归函数的公式,但我也想在我的绘图上添加 RMSE 值,也许我需要添加一些东西,但我在这里和谷歌都看不到这个问题的正确答案......
ggplot(data = AGB.rf$pred) +
geom_point(mapping = aes(x = pred, y = obs, color = pred, shape=1))+
geom_smooth(mapping = aes(x = pred, y = obs), method="lm", se = FALSE)+
stat_cor(aes(x = pred, y = obs, label = ..rr.label..),label.y = 3000)+
#stat_regline_equation(aes(x = pred, y = obs),label.y = 2700)+
labs(title = "Predicted Values vs. Observed Values with Random Forest Model", x = "Predicted AGB", y="Observed AGB")+
theme_light() + scale_shape_identity()