initial implementation of TriangleSelector#1113
Conversation
Pyright Type CompletenessView the full Project (full
Other symbols referenced but not exported by
Symbols without documentation:
Patch (exported symbols added or changed by this PR): 25.0% fully typed (2 / 8)
Patch symbol details
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4892df9. Configure here.
| for i, _ in enumerate(ultimates) | ||
| ] | ||
| ) / weights.sum(axis=-2) | ||
| ) / weights[...,:shape_check[0][1], :, :, :].sum(axis=-2) |
There was a problem hiding this comment.
Weight slice wrong broadcast axis
High Severity
_get_ultimate trims the weight array with ultimate_.shape[1], treating that size as the value-column count. After _broadcast_weights expands 4D weights_ by repeating along X.shape[0], the second axis is index replication, not columns. Slicing it to 1 drops most index-level weights and skews the voted ultimate for multi-index triangles.
Reviewed by Cursor Bugbot for commit 4892df9. Configure here.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## TriangleSelector #1113 +/- ##
====================================================
+ Coverage 90.50% 90.55% +0.04%
====================================================
Files 91 91
Lines 5289 5306 +17
Branches 671 672 +1
====================================================
+ Hits 4787 4805 +18
Misses 359 359
+ Partials 143 142 -1
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:
|


Summary of Changes
Related GitHub Issue(s)
Additional Context for Reviewers
uv run pytest) and documentation changes (uv run jb build docs --builder=custom --custom-builder=doctest)Note
Medium Risk
Changes how voting ultimates are weighted and aggregated; incorrect weight slicing could affect ensemble results when pipelines return different column counts, though existing same-shape paths should behave similarly.
Overview
Adds
TriangleSelector, a sklearn-style pipeline step that keeps a single triangle column (e.g. paid vs incurred) soVotingChainladdercan blend estimators built on different columns from the same multi-column triangle. It is exported onchainladderand covered by public API tests.VotingChainladder._get_ultimatenow gathers each estimator’sultimate_, raisesValueErrorwhen shapes disagree (with a hint about misconfiguredTriangleSelector), and slices the weight tensor to the ultimate’s column size instead of assuming it matches the full inputXshape.New voting tests cover
TriangleSelector.fit_transformand the mismatch case when one pipeline selects a column and another does not.Reviewed by Cursor Bugbot for commit 4892df9. Bugbot is set up for automated code reviews on this repo. Configure here.