feat: add tuple support and exam_cb for callbacks#665
Open
ugbotueferhire wants to merge 3 commits intointerpretml:mainfrom
Open
feat: add tuple support and exam_cb for callbacks#665ugbotueferhire wants to merge 3 commits intointerpretml:mainfrom
ugbotueferhire wants to merge 3 commits intointerpretml:mainfrom
Conversation
3c62aa9 to
5b7a76f
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #665 +/- ##
==========================================
+ Coverage 66.60% 66.86% +0.26%
==========================================
Files 76 76
Lines 11611 11681 +70
==========================================
+ Hits 7733 7811 +78
+ Misses 3878 3870 -8 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
5b7a76f to
07f9ff4
Compare
Signed-off-by: ugbotueferhire <ugbotueferhire@gmail.com>
07f9ff4 to
ca55033
Compare
Signed-off-by: ugbotueferhire <ugbotueferhire@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #635 Callback tuple support and exam callback
Description
This PR implements Phase 2 of the callback redesign for EBM training.
Phase 1 changed the callback API to keyword-only arguments and ensured the
progress callback only fires on progressing boosting steps. That work was
merged in #662.
This PR builds on top of that by allowing
callbackto accept either:The supported callback signatures are:
Why
The original callback parameter was carrying more than one kind of signal.
As discussed in the review for #662, there are really two different callback
use cases:
gain was computed for it
Splitting those concepts makes the API clearer while still keeping a single
public
callbackparameter.What Changed
_ebm.pymetricvsgaincallbackto be either a callable or a tuple of callablesexam_callbackhook in_boost.pyat the point whereavg_gainis computed
TrueValidation Rules
This PR raises a
ValueErrorfor invalid callback configurations such as:Tests
Added or covered tests for:
gainvalues in the examination callbackVerified with:
Notes