rf = randomForest(Species ~.^4, data = iris)
varImpPlot(rf)
而不是添加的互动varImpPlot
仅显示四个变量,它是否真的使用了其他互动?
答案 0 :(得分:1)
烨。互动条款包含在您的rf中:
attr(rf$terms, "term.labels")
[1] "Sepal.Length" "Sepal.Width"
[3] "Petal.Length" "Petal.Width"
[5] "Sepal.Length:Sepal.Width" "Sepal.Length:Petal.Length"
[7] "Sepal.Length:Petal.Width" "Sepal.Width:Petal.Length"
[9] "Sepal.Width:Petal.Width" "Petal.Length:Petal.Width"
[11] "Sepal.Length:Sepal.Width:Petal.Length" "Sepal.Length:Sepal.Width:Petal.Width"
[13] "Sepal.Length:Petal.Length:Petal.Width" "Sepal.Width:Petal.Length:Petal.Width"
[15] "Sepal.Length:Sepal.Width:Petal.Length:Petal.Width"