Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing argument in StratifiedKFold.split() #1304

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Programmer-RD-AI
Copy link
Contributor

@Programmer-RD-AI Programmer-RD-AI 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.
@Programmer-RD-AI
Copy link
Contributor Author

@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

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