【发布时间】: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