I am running a random forest model with cforest function, as you can see the below is result of the model that runs fine. After this, I ran the varimp() function setting default conditional= FALSE which runs, however when I try to run the same function with parameter conditional =TRUE. I am getting the following error:
> caret:::cforestStats(RF1)
RMSE Rsquared MAE
19.0656593 0.2217984 15.7459980
> RF1.coef <- varimp(RF1, conditional = TRUE, threshold = .3)
Error in terms.formula(formula, data = data) :
invalid model formula in ExtractVars
Thank you Max, for the suggestion. I was able to figure out the issue. It was mainly with the way some variables were named "Cas-45". I replace all "-" with "_" and the issue was resolved.
However it makes me wonder, why the same function worked with those same variables without having any issue when the conditional parameter was set to False and it did not worked when it was set to True.