Nested_Vs_StratifiedKFold

When we have imbalanced dataset which is better to use : Stratified k-fold cross validation is better to use Nested Cross-validation?
Thank you in advance!

Nested cross-validation and stratified k-fold.

With a stratified k-fold, you ensure that the class ratio of the different classes is the same in the training and testing set. Indeed, this is generally a good practice to use this strategy with imbalanced classification problems.

Nested cross-validation only refers to the fact that someone uses two levels of cross-validations: an inner level to tune the hyperparameter of a predictive model, an outer level to get the generalization performance of the tuned models. So this is not related to the type of problems at hand that you try to solve.

Finally, you can use nested cross-validation where the inner and outer cross-validation can use the stratified k-fold strategy.

3 Likes