I have an 5297X26 imbalanced dataset, the class1 has 588 samples and class2 has 4709 samples. I used the following code to perform random forest:
rfp<-randomForest(label~.,data=data,importance=TRUE,proximity=TRUE,replace=TRUE,sampsize=c(588,588))
Thus I could solve the imbalanced problem by selecting 588 samples from each class in each iteration. But I also want to perform cross validation for feature selection. The function I plan to use is rfcv .I tried to add sampsize=c(588,588) to the function but it didn't work. How to perform the sampling in this function?
rfcv()
exists in packagerandomForest
. $\endgroup$