microsoft / FLAML

A fast library for AutoML and tuning. Join our Discord: https://discord.gg/Cppx2vSPVP.
https://microsoft.github.io/FLAML/
MIT License
3.75k stars 495 forks source link

Fix missing argument in StratifiedKFold.split() #1304

Open Programmer-RD-AI opened 1 month ago

Programmer-RD-AI commented 1 month ago

In the evaluate_model_CV method of the generic_task.py module, the StratifiedKFold.split() method was missing a required positional argument 'y'. This caused a TypeError when attempting to split the dataset for cross-validation.

To address this issue #1303, I added the missing 'y' argument to the StratifiedKFold.split() method call. The corrected line of code now reads:

kf = kf.split(X_train_split, y_train_split)

This modification ensures that the StratifiedKFold cross-validation splits the dataset correctly, allowing the AutoML fit method to run without encountering errors.

This fix resolves the issue reported in the FLAML library when using custom StratifiedKFold cross-validation.

Why are these changes needed?

Related issue number

Checks

Programmer-RD-AI commented 1 month ago

@microsoft-github-policy-service agree