kogalur/randomForestSRC

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

Opened this issue · 1 comments

Discussed in #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!

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.