This is the exact error:
Error in randomForest.default(m, y, ...) : sampsize has too many elements.
Here is part of my code for classification (not regression) using compiled 3rd party data for prediction:
library(randomForest) library(ROCR) table(train_hc$RESPONSE) 0 1 243697 6303 table(test_hc$RESPONSE) 0 1 243566 6434
Train & test were both created from the same randomly sorted file using different records.
rfm_hc <- randomForest(RESPONSE ~ ., data=train_hc[!names(train_hc)%in%exclude_cols], nodesize=1, strata=train_hc$response, sampsize=c(6000,6000), ntree=501, mtry=5, importance=TRUE, type="prob", keep.forest=TRUE, test=test_hc, cutoff=c(0.7,0.3)) Error in randomForest.default(m, y, ...) : sampsize has too many elements.
From what I found so far it was suggested that the issue is the dependent variable levels but what I included above shows there is only two levels and response is a factor. I also was using 500k each for train & test then changed this to 250k each. This didn't help.