# Is Stratified K Fold CV Needed when Estimator implements Balanced Class Weight?

I am working on a classification task with an imbalanced dataset. I am using Sklearn's ensemble RandomForestClassifier and set its class weight to Balanced.

My question is, when I then GridSearch it, is it necessary to use Stratified K Fold or is the class weight parameter already taking care of the imbalanced class problem?

class_weight is used by random forest to assess the cost/gain when splitting the nodes of the trees, i.e. to quantify the misclassifications so that greedy split decisions can be made. However, this mechanism is not related to validation fold splits. If you want to stratify your classes into folds so that each fold preserve the approximate class proportions, you need to use StratifiedKFold as you also pointed out.