Repository navigation
Conversation
…sensitivity_benchmark DoubleMLVector.sensitivity_benchmark rebuilt the sub-models of the short-form model with _initialize_models() so that they use the reduced covariate set, but the new sub-models had no learners: in the vector API, the learners are only stored on the sub-models. Refitting the short-form model therefore always raised "Learner 'ml_l' is required but not set". Give each rebuilt sub-model the learners of the sub-model it replaces. Check that PLRVector.sensitivity_benchmark matches the legacy DoubleMLPLR.sensitivity_benchmark.
6 tasks done
SvenKlaassen
self-requested a review
November 3, 2026 06:06
SvenKlaassen
approved these changes
Nov 3, 2026
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.
Description
DoubleMLVector.sensitivity_benchmarkrebuilds the sub-models of the short-form model with_initialize_models(), so that they use the reduced covariate set. The new sub-models had no learners, because in the vector API the learners are only stored on the sub-models. Refitting the short-form model therefore always raisedValueError: Learner 'ml_l' is required but not set ..., and the method could not be used at all.doubleml/double_ml_vector.py: after rebuilding, each new sub-model gets the learners of the sub-model it replaces._learnerskeeps the full learner state created byset_learners(e.g.ml_gcloned fromml_lfor the IV-type score). It works for anyDoubleMLVectorsubclass, whatever the arguments of itsset_learners.doubleml/plm/tests/test_plr_vector_vs_plr.py: the newtest_sensitivity_benchmark_equalchecks thatPLRVector.sensitivity_benchmarkequals the legacyDoubleMLPLR.sensitivity_benchmark(rtol=1e-9). It covers both scores, both learners, andn_rep1 and 3. All 8 cases fail before the fix.Reference to Issues or PRs
Fixes #440
Comments
This only affects the unreleased vector API from #394.
PR Checklist