set.seed(123)
rf2 <- randomForest(formula = as.formula(rf_formula), data = df_train,
ntree = hyper_grid$num_trees[1], mtry = hyper_grid$mtry[1],
sampsize = ceiling(hyper_grid$sample_size[1]*nrow(df)),
nodesize = hyper_grid$node_size[1], importance = TRUE)
rf2

##
## Call:
## randomForest(formula = as.formula(rf_formula), data = df_train, ntree = hyper_grid$num_trees[1], mtry = hyper_grid$mtry[1], sampsize = ceiling(hyper_grid$sample_size[1] * nrow(df)), nodesize = hyper_grid$node_size[1], importance = TRUE)
## Type of random forest: classification
## Number of trees: 400
## No. of variables tried at each split: 8
##
## OOB estimate of error rate: 7.46%
## Confusion matrix:
## 0 1 class.error
## 0 600 8 0.01315789
## 1 42 20 0.67741935