Fix R EBM outer bag score aggregation - #677
Conversation
Signed-off-by: Temidayo Akindahunsi <98013820+TemidayoA@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #677 +/- ##
==========================================
- Coverage 67.25% 67.20% -0.06%
==========================================
Files 77 77
Lines 11735 11735
==========================================
- Hits 7892 7886 -6
- Misses 3843 3849 +6 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
CI note: I investigated the three failing checks in run
The change was validated locally with Could a maintainer please rerun the affected checks or confirm whether these are known workflow issues? |
|
Thanks @TemidayoA! I agree the failing tests are unrelated to this PR. The testR CI step for the R package completed without error, so I will merge. Good find! |
|
Thank you so much, @paulbkoch! I really appreciate you reviewing the PR, confirming the unrelated checks, and merging the fix. Glad I could help track this down, looking forward to contributing more |
Summary
Root cause
ebm_classify()overwroteterm_scoresduring each outer-bag iteration and then divided only the final bag’s scores byouter_bags. As the bag count increased, this shrank the logits toward zero and pushed predicted probabilities toward 0.5.The problem was therefore incorrect outer-bag aggregation, not a missing intercept.
Using the dataset from the issue, the mean predicted probability with 16 bags changed from
0.390069to0.100096, closely matching the observed positive rate of0.1.Validation
R CMD check --no-manualpassed, with one existing installed-size note.outer_bagsset to 1, 2, 4, 8, and 16.Fixes #417