【问题标题】:Errors and accuracy not included in call: model - Random forest model调用中不包括错误和准确性:模型 - 随机森林模型
【发布时间】:2020-09-24 16:12:53
【问题描述】:

我是第一次使用随机森林。我想知道为什么在运行模型后我看不到调用中的所有统计信息。例如,我还希望看到准确性和 OOB 错误。

rf <-randomForest(VWC~.,data=Data_All, 
                  mtry=best.m, importance=TRUE,
                  ntree=500)
print(rf)

Call:
 randomForest(formula = VWC ~ ., data = Data_All, mtry = best.m,      importance = TRUE, ntree = 500) 
               Type of random forest: regression
                     Number of trees: 500
No. of variables tried at each split: 41

          Mean of squared residuals: 4422.255
                    % Var explained: 49.43

我选择了几列,因为它是一个巨大的数据框:

dput(Data_All[1:20, c(1, 8)])
structure(list(VWC = c(56.1, 50.6, 60.7, 40.1, 47.3, 52.8, 51.4, 
44, 47.1, 51.9, 47.7, 51, 45.3, 49.3, 52.4, 51.8, 52.2, 49, 46.1, 
44.4), vh_glcm_7 = c(0.910762965, 0.910106623, 0.91908574, 0.926299954, 
0.945425676, 0.948440292, 0.948440292, 0.940617102, 0.938677993, 
0.927837995, 0.928881178, 0.931472503, 0.927350345, 0.919106027, 
0.917548344, 0.922729618, 0.93057993, 0.93057993, 0.931927558, 
0.927018363)), row.names = c(NA, 20L), class = "data.frame")

【问题讨论】:

  • 因为这是回归,至少模型是这样看的。
  • 我明白了。谢谢!所以我需要更好地理解 %Var 解释是什么。
  • 您能否也给我们一个dput(head(Data_All, 20)) 并将其添加到问题中?
  • 感谢您提供的数据片段。这已经足够了。我删除了我的答案,因为它没有帮助并且赞成@user2974951。我唯一可以增加的价值是你会发现这个包和小插图很有用。 cran.r-project.org/web/packages/randomForestExplainer/vignettes/…
  • 谢谢!这实际上很有帮助。

标签: r statistics random-forest


【解决方案1】:

对于回归,没有准确度,而是 MSE 和 R^2 (% Var),它们是回归的标准度量,如果您还不了解它们,则应该研究它们。

【讨论】:

    猜你喜欢
    • 2017-10-20
    • 2013-12-03
    • 2016-01-24
    • 2019-07-10
    • 2017-08-11
    • 2020-02-25
    • 2015-10-26
    • 2016-04-09
    • 2019-08-02
    相关资源
    最近更新 更多