如何使用 ggplot 在绘图上添加 RMSE 值

数据挖掘 r ggplot2 rmse
2022-02-20 12:56:33

我添加了 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()
0个回答
没有发现任何回复~