1
rf = randomForest(Species ~.^4, data = iris) varImpPlot(rf)
在式接口添加相互作用中的R隨機森林
代替加入相互作用varImpPlot
僅示出了四個變量,它是真的使用額外的相互作用?
rf = randomForest(Species ~.^4, data = iris) varImpPlot(rf)
在式接口添加相互作用中的R隨機森林
代替加入相互作用varImpPlot
僅示出了四個變量,它是真的使用額外的相互作用?
是。互動條款包括在你的射頻:
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"
所以,爲什麼我不在'varImpPlot(rf)'plot中看到它們? – Qbik