Fix seed parameter TypeError in BaseDRLearner bootstrap CI (#857)#879
Open
mohsinm-dev wants to merge 1 commit intouber:masterfrom
Open
Fix seed parameter TypeError in BaseDRLearner bootstrap CI (#857)#879mohsinm-dev wants to merge 1 commit intouber:masterfrom
mohsinm-dev wants to merge 1 commit intouber:masterfrom
Conversation
Remove stray seed=seed argument passed to bootstrap() which did not accept it, causing TypeError when bootstrap_ci=True. Add local RNG-based seeding for reproducible bootstrap CI in both estimate_ate() and fit_predict() without mutating global numpy state. Override bootstrap() in BaseDRLearner to thread per-iteration seeds into fit() for deterministic cross-fitting.
jeongyoonlee
requested changes
Feb 24, 2026
| bootstrap_ci=True, | ||
| n_bootstraps=10, | ||
| bootstrap_size=200, | ||
| seed=42, |
Collaborator
There was a problem hiding this comment.
Let's use from .const import RANDOM_SEED instead.
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.
Fixes #857
BaseDRLearner.estimate_ate()passedseed=seedtoself.bootstrap(), which doesn't accept that parameter — raisingTypeErrorwheneverbootstrap_ci=True.Changes:
seed=seedfrom bootstrap callseedcontrols bootstrap reproducibility without mutating global numpy statebootstrap()inBaseDRLearnerto pass per-iteration seeds intofit()for deterministic cross-fittingfit_predict(return_ci=True)pathTests:
TypeError