I am using the following function to do cross-validation with the random forest algorithm on my dataset. However, ntree raises an error, saying that it is not used in the function. Even though I have seen that usage as a recommendation comment before in one of the threads regarding this issue, it did not work at me. Here is my code:
cv_rf_class1 <- train(y_train_u ~ ., x_train_u ,
method ="cforest",
trControl = trainControl(method = "cv",
number = 10,
verboseIter = TRUE),
ntree = 100))
If I cannot change the ntree parameter, it uses 500 trees as default in the function and it raises another error for me (subscript out of bounds), so I cannot make it work for my problem. How can I fix this issue in order to make my function work?