pbreheny / visreg

Visualization of regression functions
http://pbreheny.github.io/visreg/
61 stars 18 forks source link

visreg does not work for random forests with subset #128

Open pbreheny opened 1 day ago

pbreheny commented 1 day ago

First call works; second one does not.

library(randomForest)
data('Boston', package='MASS')
train <- sample(1:nrow(Boston), nrow(Boston) / 2)
randomForest(medv ~ ., data = Boston) |> visreg::visreg('lstat')
randomForest(medv ~ ., data = Boston, subset=train) |> visreg::visreg('lstat')