uclamii / model_tuner

A library to tune the hyperparameters of common ML models. Supports calibration and custom pipelines.
Apache License 2.0
3 stars 0 forks source link

added flexibility between bool and None for strat param #87

Closed lshpaner closed 2 weeks ago

lshpaner commented 2 weeks ago

This pull request enhances the train_val_test_split function by standardizing the handling of stratification parameters stratify_y and stratify_cols. Previously, passing stratify_y=False or stratify_cols=False did not disable stratification as users might expect. This fix ensures that both parameters interpret False as disabling stratification, thereby improving the function's usability and intuitiveness as follows:

if stratify_y is False:
    stratify_y = None
if stratify_cols is False:
    stratify_cols = None