# Implementing “Balanced Random Forest” in h2o

Currently having problems with (very) imbalanced classes in a dataset that I am trying to run binary classification on. Looking at this UC Berkeley article (http://statistics.berkeley.edu/sites/default/files/tech-reports/666.pdf), I would like to try using a "Balanced Random Forest" (using h2o flow UI). From the paper:

Random forest inspired us to ensemble trees induced from balanced down-sampled data. The Balanced Random Forest (BRF) algorithm is shown below:

1. For each iteration in random forest, draw a bootstrap sample from the minority class. Randomly draw the same number of cases, with replacement, from the majority class.
2. Induce a classification tree from the data to maximum size, without pruning. The tree is induced with the CART algorithm, with the following modification: At each node, instead of searching through all variables for the optimal split, only search through a set of mtry randomly selected variables.
3. Repeat the two steps above for the number of times desired. Aggregate the predictions of the ensemble and make the final prediction

My question is whether there is a way to implement such a model using the hyperparameters of the existing DRF model in h2o (http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/drf.html). My thought is that setting the hyperparameters of the h2o DRF model as:

balance_classes = False
fold_assignment = stratified     (though I wish there were some "unbalanced classes" option)
stopping_rounds = 0              (to force max size (I don't think h2o DRFs have pruning options))
mtries = -1                      (the article did not seem to recommend any ideal "mtry" size)
sample_rate_per_class = 0.5, 0.5
binomial_double_trees = True     (just because, I don't really think it affects the BRF alg.)


would be the thing to do. For many of the other hyperparameters, I'd probably just use whatever h2o flow UI recommends as the default values.

Does this look like it would work at approximating the BRF alg. described? Should I add (or remove) any other specific hyperparameter settings? Advice would be appreciated.

** Note: I have seen the other post on SO with similar questions (https://stackoverflow.com/questions/45618685/balanced-random-forest-in-r, Implementing Balanced Random Forest (BRF) in R using RandomForests), but I believe this is different as it is not a package recommendation question, but rather asking about implementation in a specific framework.