Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Callbacks] ENH Avoid repeating the no callback support warning - #34026

Closed
FrancoisPgm wants to merge 1 commit into
scikit-learn:callbacksfrom
FrancoisPgm:callback_one_warning
Closed

[Callbacks] ENH Avoid repeating the no callback support warning#34026
FrancoisPgm wants to merge 1 commit into
scikit-learn:callbacksfrom
FrancoisPgm:callback_one_warning

Conversation

@FrancoisPgm

Copy link
Copy Markdown
Contributor

Reference Issues/PRs

Fixes #33328
This a rework of jeremiedbb#33

What does this implement/fix? Explain your changes.

Lazily create an attribute on the root context recording the messages of raised warnings for no callback support in a sub-estimator, so that if the warning is raised only once. This fix does not work when parallelizing the meta-estimator, but I don't see how to tackle that case without introducing some inter threads or processes communication and I don't think it would be worth it.

Add a check in the tests that the warning is only raised once.

Remove test_inner_estimator_no_callback_support which was testing the warning, as it is redundant with test_autopropagation_to_callback_agnostic_subestimator.

Update the warning message to make it slightly clearer.

AI usage disclosure

I used AI assistance for:

  • Research and understanding

Any other comments?

ping @jeremiedbb, @StefanieSenger

@adrinjalali
adrinjalali deleted the branch scikit-learn:callbacks May 19, 2026 08:34
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