0
私は1つのデータセットでランダムフォレストをテストしています。 1つのデータフレームですべてのRFの可変重要度を出力したいと思います。エラーがスローされます多数のフォレストの集約(RF)変数重要度
forests <- grep("rf", ls(), value=T)
importances <- do.call(cbind, lapply(forests, importance))
:ような何か
Error in UseMethod("importance") : no applicable method for 'importance' applied to an object of class "character"
私はリストにforests
を変換しようとしたが、それはどちらかの助けにはなりませんでした。
例:
rf10 <- randomForest(mpg ~., mtcars, ntree=10)
rf100 <- randomForest(mpg ~., mtcars, ntree=100)
cbind(importance(rf10), importance(rf100))
ありがとう、@ jav。それは恥ずかしいほど簡単でした。 – DGenchev