Skip to content

#882 full exp#884

Open
henrydingliu wants to merge 2 commits into
mainfrom
#882-full-exp
Open

#882 full exp#884
henrydingliu wants to merge 2 commits into
mainfrom
#882-full-exp

Conversation

@henrydingliu
Copy link
Copy Markdown
Collaborator

@henrydingliu henrydingliu commented May 30, 2026

Summary of Changes

allows a predicted triangle (e.g. cl.Chainladder().fit_predict(tri) to call the full_expectation_ property

Related GitHub Issue(s)

closes #882

Additional Context for Reviewers

mirrors the logic from full_triangle_

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

Note

Low Risk
Small property logic aligned with existing full_triangle_ behavior plus test tightening; no auth, security, or external API surface beyond actuarial helpers.

Overview
full_expectation_ now picks the cumulative vs incremental flag the same way as full_triangle_: use X_.is_cumulative when a fitted X_ exists, otherwise self.is_cumulative. That lets fit_predict outputs (e.g. cl.Chainladder().fit_predict(tri)) expose full_expectation_ without relying on a missing or wrong X_ attribute.

Tests add fit_predict vs fit full_expectation_ checks with np.allclose, and replace hard-coded 0.00001 tolerances with the shared atol fixture.

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

@codecov
Copy link
Copy Markdown

codecov Bot commented May 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.05%. Comparing base (449b5c1) to head (91c528d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #884   +/-   ##
=======================================
  Coverage   87.04%   87.05%           
=======================================
  Files          86       86           
  Lines        4986     4989    +3     
  Branches      646      647    +1     
=======================================
+ Hits         4340     4343    +3     
  Misses        456      456           
  Partials      190      190           
Flag Coverage Δ
unittests 87.05% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

full_expectation_ doesn't work on predicted triangle

1 participant