Repository navigation
Conversation
Fit each meta-learner (S/T/X/R/DR, regressor and classifier variants) and the causal and uplift tree/forest learners on the small conftest datasets, pickle them, and assert the size stays under a per-learner budget set at about 2x the current size. A change that starts keeping training data or other data-sized state on a fitted learner now fails the test instead of silently growing every saved model. Part of v1.0 roadmap M1 (discussion uber#938). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Proposed changes
Closes #1063
This adds
tests/test_pickle_size.py, the pickle-size guard from M1 in #938. Each learner (S, T, X, R, DR meta-learners for regression and classification, plus CausalTree, CausalRandomForest, UpliftTree and UpliftRandomForest) is fit on the existing conftest data, pickled, and checked against a budget inPICKLE_SIZE_BUDGETS.The budgets are about 2x the sizes I measured, which are listed next to each one. The meta-learner sizes did not change when I went from 1000 to 4000 training rows, so nothing data-sized is stored today, and a change that starts keeping training data would fail right away. The comment above the dict explains how to re-measure and update a budget when growth is expected. A small check also keeps the budget dict and the tested learners in sync.
Types of changes
Checklist
Further comments
All 14 tests pass locally in about 10 seconds and the file passes
black --check. No CI config changes are needed because the file sits intests/. The two R-learners take a few seconds each because cross-validation starts parallel workers (#1060 addscv_n_jobs, which could speed this up later).I used Claude to help write this, and reviewed and tested it myself.