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

Supply eval_sample_weight for fit in EarlyStoppingShapRFECV #144

Merged
merged 2 commits into from
Apr 28, 2021

Conversation

timlod
Copy link
Contributor

@timlod timlod commented Apr 28, 2021

If using sample weighting for fitting in LGBM, one should also supply it for the evaluation set, otherwise the early stopping condition won't be reached when using binary_log_loss as the eval_metric. The reason is that training sample weights may increase the training log loss to be generally larger than the validation loss, even though the validation loss stopped improving.

Most other metrics were not affected, which is why this wasn't caught before.

timlod added 2 commits April 28, 2021 12:17
- LGBM internally uses the sample weights for the training set
eval_metric calls - while clf metrics such as rocauc or precision won't
be impacted, during evaluation, log loss as eval_metric will result in
never stopping if it is used without sample_weighting.
Copy link
Contributor

@Matgrb Matgrb left a comment

Choose a reason for hiding this comment

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

Nice, thanks! Does it also make sense then to use sample_weight in scorers as well?

@timlod
Copy link
Contributor Author

timlod commented Apr 28, 2021

Same discussion as previously - personally I don't (want to) use it like that, but it may make sense to add it as an option in the future!

@Matgrb Matgrb merged commit 3c3ad93 into ing-bank:main Apr 28, 2021
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