thecocolab / data-imbalance

Evaluating the effect of data balance on different classification metrics
https://doi.org/10.1101/2022.07.18.500262
MIT License
6 stars 0 forks source link

Do we have the option for stratified k-fold ? #10

Closed k-jerbi closed 2 years ago

PhilippThoelke commented 2 years ago

Yes, you can pass any kind cross-validation to the pipeline with the cross_validation argument. Stratified k-fold would look something like this:

from sklearn.model_selection import StratifiedKFold
Pipeline(x, y, groups, cross_validation=StratifiedKFold(n_splits=10), ...)