可变重要性图
我正在从随机森林回归中研究可变的重要性图,并希望使用VIP软件包将可变标签应用于Y轴而不是隐秘的变量名称,以易于解释。
如何修改代码以在Y轴上添加标签?
我当前的代码:
library(randomForest)
library(vip)
model1 <- randomForest(y ~ .,
data=train,
mtry = 8,
ntree=500,
import[enter image description here][1]ance=TRUE,
proximity=TRUE)
plot_rf_1 <- vip(model1,
num_features = 6,
include_type = TRUE,
geom = "point",
horizontal = TRUE,
mapping = aes_string(fill="var.labels"),
aesthetics = list(color = "blue", shape = 16, size = 3)) +
theme_light()
grid.arrange(plot_rf_1, nrow = 1)```
可变重要性图:
I'm working on variable importance plot from random forest regression and want to apply variable labels to y-axis instead of cryptic variable names using the VIP package for ease of interpretation.
How to modify the code to add labels on y axis?
My current code:
library(randomForest)
library(vip)
model1 <- randomForest(y ~ .,
data=train,
mtry = 8,
ntree=500,
import[enter image description here][1]ance=TRUE,
proximity=TRUE)
plot_rf_1 <- vip(model1,
num_features = 6,
include_type = TRUE,
geom = "point",
horizontal = TRUE,
mapping = aes_string(fill="var.labels"),
aesthetics = list(color = "blue", shape = 16, size = 3)) +
theme_light()
grid.arrange(plot_rf_1, nrow = 1)```
Variable importance plot:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论