R pdp包在部分依赖图中的地毯问题

时间:2018-11-26 19:06:08

标签: r dependencies partial

我在r中使用pdp软件包绘制部分依赖图。以iris数据为例。

library(randomForest)
library(pdp)
rf = randomForest(Species~., data = iris)
par.Sepal_l <- partial(rf, pred.var = c("Sepal.Length"))
plot.Sepal_l <- autoplot(par.Sepal_l, rug=TRUE, train = iris)
print(plot.Sepal_l)

我得到了如下图:

enter image description here

我使用rug=TRUE选项显示预测变量的分布。但是,我发现沿x轴的地毯比预期的稀疏得多。我做错什么了吗?这似乎是不对的。但是我无法弄清楚为什么我似乎丢失了一些数据点。

非常感谢。

0 个答案:

没有答案
相关问题