Unbalanced data set - how to optimize hyperparams via grid search?
Scikit-learn's GridSearchCV uses StratifiedKFold so all classes will be proportional represented in the splits. GridSearchCV can be used for hyperparameter search.
Imbalanced-learn's SMOTE can also be used. If there are fewer samples than k, it will only use available samples.