For sample size, in r, samplesize = if replace, nrow(x) else ceiling(0.632*nrow(x))
What I know is random forest constructs a large number of trees with random bootstrap samples from the training data.
But, in r, if we have a sample size of replacement, we use all the observations. Then, it's not random. Can you please explain what you mean by random bootstrap samples if "replace"?
S3 method for class 'formula'
randomForest(formula, data=NULL, ..., subset, na.action=na.fail)
Default S3 method:
randomForest(x, y=NULL, xtest=NULL, ytest=NULL, ntree=500, mtry=if (!is.null(y) && !is.factor(y)) max(floor(ncol(x)/3), 1) else floor(sqrt(ncol(x))), replace=TRUE, classwt=NULL, cutoff, strata, sampsize = if (replace) nrow(x) else ceiling(.632*nrow(x)),...
– shawn Apr 19 '23 at 21:23