I am getting confused by the behaviour of the varimp()
function from party package.
I am using conditional random forest to get variable importance following Strobl et al. 2009 recommendations.
It works just fine for all my datasets but one. I have to subset my observation for this one. But, even if the conditional random forest run normaly on the full dataset, it returns only zeros for the subset... and seem to don't run at all but no error is generated.
I wondered if the number of predictors is too much for only few observations and try with only a restricted number of predictors but it gives me the same results. It does not seem either to be link to variable type as it was pointed out in other cases...
I am obviously missing something but I just can not figure out what...
If someone has an insight of the direction I should be looking at, I would be so grateful.
My data here.
VarforCRF <- read.csv("Data.csv",sep=";",dec=",",row.names=1)
library(party)
set.seed(round(runif(1,0,1)*10000))
# Run just fine with the entire dataset
cRF <- cforest(Syrph_pred~.,data = VarforCRF, control = cforest_unbiased(ntree=100))
varimp(object = cRF,conditional = T)
CRF_West <- subset(VarforCRF,Sector == "West")
# Does not seem to run at all with subset and return zeros
cRF_W <- cforest(Syrph_pred~.,data = CRF_West, control = cforest_unbiased(ntree=100))
varimp(object = cRF_W,conditional = T)