Skip to content

initial implementation of TriangleSelector#1114

Open
henrydingliu wants to merge 1 commit into
mainfrom
TriangleSelector
Open

initial implementation of TriangleSelector#1114
henrydingliu wants to merge 1 commit into
mainfrom
TriangleSelector

Conversation

@henrydingliu

@henrydingliu henrydingliu commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary of Changes

New workflow step for combining incurred/paid into a single VotingChainladder estimator

Related GitHub Issue(s)

helps with various chapters of #588

Additional Context for Reviewers

  • I passed tests locally for both code (uv run pytest) and documentation changes (uv run jb build docs --builder=custom --custom-builder=doctest)

Note

Medium Risk
Changes how VotingChainladder combines weighted ultimates, which affects ensemble reserving results whenever column dimensions differ across estimators.

Overview
Adds TriangleSelector, a sklearn-style pipeline step that narrows a Triangle to a single column (e.g. paid vs incurred) so each branch of a VotingChainladder can run on different measures from the same input.

VotingChainladder blending in _get_ultimate is updated so weighted combinations use each estimator’s ultimate_ shape instead of assuming it matches the full input triangle; mismatched shapes raise a ValueError with a hint about TriangleSelector. The class is exported from chainladder and covered by workflow tests plus the public API guard.

Reviewed by Cursor Bugbot for commit dfba575. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

Copy link
Copy Markdown

Pyright Type Completeness

View the full pyright --verifytypes output for this commit

Project (full chainladder package, at this PR's head): 14.6% of exported symbols fully typed (187 / 1280)

Known Ambiguous Unknown Total
Project (head) 187 106 987 1280

Other symbols referenced but not exported by chainladder: 13

Known Ambiguous Unknown Total
Other (head) 3 1 9 13

Symbols without documentation:

  • Functions without docstring: 315
  • Functions without default param: 0
  • Classes without docstring: 10

Patch (exported symbols added or changed by this PR): 25.0% fully typed (2 / 8)

Known Ambiguous Unknown Total
Patch 2 0 6 8
Patch symbol details
Symbol Status Change
chainladder.workflow.TriangleSelector ❌ unknown new
chainladder.workflow.tests.test_voting.test_mismatching_tri_sel ❌ unknown new
chainladder.workflow.tests.test_voting.test_tri_sel ❌ unknown new
chainladder.workflow.voting.TriangleSelector ❌ unknown new
chainladder.workflow.voting.TriangleSelector.__init__ ✅ known new
chainladder.workflow.voting.TriangleSelector.col ✅ known new
chainladder.workflow.voting.TriangleSelector.fit ❌ unknown new
chainladder.workflow.voting.TriangleSelector.transform ❌ unknown new

@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.55%. Comparing base (32ae098) to head (dfba575).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1114      +/-   ##
==========================================
+ 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     
Flag Coverage Δ
unittests 90.55% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant