cleverly.DRTMLEMethod#
- class cleverly.DRTMLEMethod(models: ModelSpec = ModelSpec(outcome_learner=None, treatment_learner=None, missingness_learner=None, intermediate_learner=None, pseudo_learner=None, censoring_learner=None, density_bins=None, ratio='density', screen_treatment=False, screen_threshold=0.1, min_retain=None, outcome_by_arm=False, survival_model='iterated_mean'), cross_fitting: CrossFitting = CrossFitting(enabled=True, n_folds=10, learner_folds=5, repeats=1, stratify_by='none', targeting_scheme='pooled', fold_evaluation=False, split_plan=None), targeting: Targeting = Targeting(fluctuation='logistic', algorithm='iterative', g_bounds='auto', q_bounds=None, nuisance_bound=0.01, submodel_alpha=0.9995, target_weights=False, step_size=0.001, max_iter=20, tol=1e-10, stopping='relative', step_bound=None, step_search=True, iterate='last', isotonic=False), inference: Inference = Inference(alpha=0.05, n_bootstrap=0, bootstrap_resampling='auto', simultaneous=True, n_multiplier='auto', multiplier_kind='rademacher'), runtime: Runtime = Runtime(random_state=None, run_id=None, n_jobs=1), name: str = 'drtmle', guard: tuple[str, ...] = ('Q', 'g'), reduction: str = 'univariate', reduced_outcome_learner: Any = None, reduced_treatment_learner: Any = None, reduced_crossfit: str = 'pooled', update_order: str = 'drtmle', evaluation: Any = None, randomized: bool = False)[source]#
Configure the reduced-dimension DR-TMLE correction.
- Parameters:
- models
ModelSpec Nuisance learners and related model settings.
- cross_fitting
CrossFitting Sample-splitting settings.
- targeting
Targeting Fluctuation and solver settings.
- inference
Inference Interval and resampling settings.
- runtime
Runtime Seed, run identifier, and parallelism.
- name
str Stable method name.
- guard
tupleof{“Q”, “g”}, default=(“Q”, “g”) The extra score equations to solve, named by the nuisance whose misspecification each one corrects:
"Q"adds equation (9) and"g"adds equation (10).- reduction{“univariate”, “bivariate”}, default=”univariate”
Reduced-regression family.
- reduced_outcome_learner
estimatororNone, default=None Learner for the reduced outcome regression.
- reduced_treatment_learner
estimatororNone, default=None Learner for the reduced treatment regression.
- reduced_crossfit{“pooled”, “nested”}, default=”pooled”
Cross-fitting policy for reduced regressions.
- update_order{“drtmle”, “benkeser”}, default=”drtmle”
Order of reduced targeting updates.
- evaluation
dataframeorNone, default=None Optional evaluation data for a companion fit.
- randomizedbool, default=False
Whether treatment was randomized, for a fit with missing outcomes.
Falsefits an observational missing outcome with the composite indicator. Known treatment probabilities belong to the design:PointTreatment(treatment_probabilities=...).
- models
See also
TMLEMethodThe base configuration, without the reduced-dimension correction.
CollaborativeTMLEMethodA treatment mechanism selected for the targeted estimate.
ModelSpecOwns the first-stage learners the reduced regressions correct.
Examples
>>> from cleverly import DRTMLEMethod >>> method = DRTMLEMethod(guard=("Q", "g")) >>> method.name, method.guard ('drtmle', ('Q', 'g'))
A randomized trial knows its own treatment mechanism, so only the outcome regression needs guarding:
>>> DRTMLEMethod(guard=("Q",), randomized=True).guard ('Q',)