FLAML icon indicating copy to clipboard operation
FLAML copied to clipboard

Fix missing argument in StratifiedKFold.split()

Open Programmer-RD-AI opened this issue 1 year ago • 1 comments
trafficstars

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

  • [ ] I've included any doc changes needed for https://microsoft.github.io/FLAML/. See https://microsoft.github.io/FLAML/docs/Contribute#documentation to build and test documentation locally.
  • [ ] I've added tests (if relevant) corresponding to the changes introduced in this PR.
  • [ ] I've made sure all auto checks have passed.

Programmer-RD-AI avatar May 21 '24 15:05 Programmer-RD-AI

@microsoft-github-policy-service agree

Programmer-RD-AI avatar May 21 '24 15:05 Programmer-RD-AI