Workflows

Common calibratedDML workflows.

This page gives a concise map of the standard calibrated DML workflows: fitting from raw data, starting from supplied nuisance estimates, and multi-arm analyses. For tested end-to-end walkthroughs, use the Tutorials page, which links to Python notebooks, script mirrors, and R vignettes.

Workflows

Common workflows

Each card gives when to use it and the corresponding Python and R entry points.

Standard workflow

Standard estimator from raw data

Use when the package should fit nuisance models, calibrate them, and report inference from raw data.

Python

CalibratedDML(...).fit(X, A, y)

R

calibrated_dml(data, outcome, treatment, covariates, ...)

Supplied nuisances

Estimator from supplied nuisance matrices

Use when cross-fitted nuisance estimates are already available and only calibration, debiasing, and inference should be run here.

Python

CalibratedDML(...).fit_from_nuisances(A, y, mu_mat, pi_mat, ...)

R

calibrated_dml_from_nuisances(A, Y, mu_mat, pi_mat, ...)

Multi-arm treatment

Multi-arm treatment with control contrasts

Use when treatment has more than two levels and the estimand is arm means plus treatment-versus-control contrasts.

Python

CalibratedDML(control_level=0, ...)

R

calibrated_dml(..., control_level = 0)

Custom learners

Custom learners and external nuisance pipelines

Use when you want to choose the nuisance learners yourself or bring in nuisance estimates from another pipeline.

Python

Pass sklearn-compatible regressors for outcome nuisance estimation and probabilistic classifiers for treatment nuisance estimation.

CalibratedDML(outcome_model=..., treatment_model=...).fit(X, A, y)

R

Use built-in learner names, a SuperLearner library, or an sl3 learner.

calibrated_dml(..., outcome_model = ..., treatment_model = ...)

For full control in either interface, use the supplied-nuisance workflow with fit_from_nuisances(...) or calibrated_dml_from_nuisances(...). R-side learner support is documented on the R package page.

Practical Notes

Three practical things to check

Supplied nuisance estimates should usually be cross-fitted. The inference layer should also be chosen deliberately.

Supplied nuisances

When you use the direct nuisance path, the expected input is a set of cross-fitted nuisance estimates rather than in-sample fits.

Inference choice

Standard calibrated DML uses jackknife intervals by default. They adapt to nuisance misspecification, are cheaper than the bootstrap, and worked better in our simulations. Use Wald only when both nuisances are consistent, even if one converges arbitrarily slowly.

Custom learners

Custom learners are interface-specific: Python accepts sklearn-compatible estimators, while R accepts built-in model specs plus optional SuperLearner and sl3 backends.

Tutorials

Long-form walkthroughs

The Tutorials page collects the tested Python notebooks, script mirrors, and R vignettes for the standard calibrated DML workflows when you want more than the concise workflow summaries on this page.