kogalur / randomForestSRC

DOCUMENTATION:
https://www.randomforestsrc.org/
GNU General Public License v3.0
113 stars 18 forks source link

"split.depth" parameter in predict(....) #288

Open ishwaran opened 1 year ago

ishwaran commented 1 year ago

Discussed in https://github.com/kogalur/randomForestSRC/discussions/287

Originally posted by **Jiangnan-Lyu** July 6, 2022 How do I extract the average split depth for each variable of each instance for the prediction set? I tried to set the parameter **split.depth= "all.trees"** in function **predict(...)**, but my computer keeps crashing within a second when running it. Here is an example: ``` library(dplyr) library(randomForestSRC) A <- imbalance::ecoli1 d <- A[sample(1:nrow(A)),] %>% mutate(Class=factor(Class,levels=c("negative","positive"),labels = c('0','1'))) train<-d[1:(nrow(d)/2),] test<-d[-(1:(nrow(d)/2)),] %>% select(-'Class') o <- imbalanced(Class~., train, split.depth="all.trees") o.pred <- predict(o, test, split.depth="all.trees") ## crashes at this line ``` Thanks so much in advance for help!
ishwaran commented 1 year ago

Hi, thanks for pointing this out since it looks like it's a bug (probably introduced in the last CRAN release or maybe a few releases earlier). We will fix it and get back to you.