E52C Fix missing argument in StratifiedKFold.split() by prdai · Pull Request #1304 · microsoft/FLAML · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@prdai
Copy link
Contributor
@prdai prdai commented May 21, 2024

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

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, I added the missing 'y' argument to the `StratifiedKFold.split()` method call. The corrected line of code now reads:

```python
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.
@prdai
Copy link
Contributor Author
prdai commented May 21, 2024

@microsoft-github-policy-service agree

state.fit_kwargs[
"sample_weight"
] = (
state.fit_kwargs["sample_weight"] = (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets reduce the change, keep it focus

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you elaborate? thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0