DoubleML 0.9.0__tar.gz → 0.9.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {DoubleML-0.9.0 → doubleml-0.9.2}/DoubleML.egg-info/PKG-INFO +17 -9
- {DoubleML-0.9.0 → doubleml-0.9.2}/DoubleML.egg-info/SOURCES.txt +24 -1
- doubleml-0.9.2/DoubleML.egg-info/requires.txt +16 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/PKG-INFO +17 -9
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/double_ml_data.py +20 -20
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/apo.py +11 -4
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/irm.py +11 -4
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_apo.py +13 -4
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_irm.py +13 -4
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/plr.py +11 -4
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/tests/test_plr.py +13 -4
- doubleml-0.9.2/doubleml/rdd/__init__.py +9 -0
- doubleml-0.9.2/doubleml/rdd/_utils.py +12 -0
- doubleml-0.9.2/doubleml/rdd/datasets/__init__.py +9 -0
- doubleml-0.9.2/doubleml/rdd/datasets/simple_dgp.py +108 -0
- doubleml-0.9.2/doubleml/rdd/rdd.py +618 -0
- doubleml-0.9.2/doubleml/rdd/tests/conftest.py +130 -0
- doubleml-0.9.2/doubleml/rdd/tests/test_rdd_classifier.py +29 -0
- doubleml-0.9.2/doubleml/rdd/tests/test_rdd_classifier_fuzzy.py +98 -0
- doubleml-0.9.2/doubleml/rdd/tests/test_rdd_classifier_fuzzy_left.py +98 -0
- doubleml-0.9.2/doubleml/rdd/tests/test_rdd_classifier_fuzzy_right.py +98 -0
- doubleml-0.9.2/doubleml/rdd/tests/test_rdd_classifier_sharp.py +98 -0
- doubleml-0.9.2/doubleml/rdd/tests/test_rdd_default_values.py +35 -0
- doubleml-0.9.2/doubleml/rdd/tests/test_rdd_exceptions.py +224 -0
- doubleml-0.9.2/doubleml/rdd/tests/test_rdd_fuzzy.py +95 -0
- doubleml-0.9.2/doubleml/rdd/tests/test_rdd_fuzzy_left.py +95 -0
- doubleml-0.9.2/doubleml/rdd/tests/test_rdd_fuzzy_right.py +95 -0
- doubleml-0.9.2/doubleml/rdd/tests/test_rdd_not_installed.py +11 -0
- doubleml-0.9.2/doubleml/rdd/tests/test_rdd_return_types.py +56 -0
- doubleml-0.9.2/doubleml/rdd/tests/test_rdd_sharp.py +95 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/test_dml_data.py +8 -8
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/utils/__init__.py +4 -1
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/utils/_checks.py +26 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/utils/_estimation.py +9 -5
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/utils/blp.py +12 -3
- doubleml-0.9.2/doubleml/utils/global_learner.py +112 -0
- doubleml-0.9.2/doubleml/utils/tests/__init__.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/utils/tests/_utils_blp_manual.py +3 -3
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/utils/tests/test_blp.py +35 -4
- doubleml-0.9.2/doubleml/utils/tests/test_exceptions_global_learners.py +18 -0
- doubleml-0.9.2/doubleml/utils/tests/test_global_learners.py +121 -0
- doubleml-0.9.2/doubleml/utils/tests/test_var_est_and_aggregation.py +103 -0
- doubleml-0.9.2/pyproject.toml +50 -0
- doubleml-0.9.2/pytest.ini +9 -0
- DoubleML-0.9.0/DoubleML.egg-info/requires.txt +0 -7
- DoubleML-0.9.0/doubleml/utils/tests/test_var_est_and_aggregation.py +0 -67
- DoubleML-0.9.0/pytest.ini +0 -4
- DoubleML-0.9.0/setup.py +0 -43
- {DoubleML-0.9.0 → doubleml-0.9.2}/DoubleML.egg-info/dependency_links.txt +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/DoubleML.egg-info/top_level.txt +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/LICENSE +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/MANIFEST.in +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/README.md +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/__init__.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/datasets.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/did/__init__.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/did/did.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/did/did_cs.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/did/tests/__init__.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/did/tests/_utils_did_cs_manual.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/did/tests/_utils_did_manual.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/did/tests/conftest.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/did/tests/test_did.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/did/tests/test_did_cs.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/did/tests/test_did_cs_external_predictions.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/did/tests/test_did_cs_tune.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/did/tests/test_did_external_predictions.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/did/tests/test_did_tune.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/double_ml.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/double_ml_framework.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/double_ml_score_mixins.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/__init__.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/apos.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/cvar.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/iivm.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/lpq.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/pq.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/qte.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/ssm.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/__init__.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/_utils_apo_manual.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/_utils_apos_manual.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/_utils_cvar_manual.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/_utils_iivm_manual.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/_utils_irm_manual.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/_utils_lpq_manual.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/_utils_pq_manual.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/_utils_qte_manual.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/_utils_ssm_manual.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/conftest.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_apo_classifier.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_apo_exceptions.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_apo_external_predictions.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_apo_tune.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_apo_weighted_scores.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_apos.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_apos_classfier.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_apos_exceptions.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_apos_external_predictions.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_apos_weighted_scores.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_cvar.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_cvar_tune.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_iivm.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_iivm_classifier.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_iivm_external_predictions.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_iivm_subgroups.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_iivm_tune.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_irm_classifier.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_irm_external_predictions.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_irm_tune.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_irm_weighted_scores.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_irm_with_missings.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_lpq.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_lpq_external_predictions.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_lpq_tune.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_pq.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_pq_external_predictions.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_pq_tune.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_qte.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_qte_exceptions.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_ssm.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_ssm_exceptions.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/irm/tests/test_ssm_tune.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/__init__.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/pliv.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/tests/__init__.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/tests/_utils_pliv_manual.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/tests/_utils_pliv_partial_x_manual.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/tests/_utils_pliv_partial_xz_manual.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/tests/_utils_pliv_partial_z_manual.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/tests/_utils_plr_manual.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/tests/conftest.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/tests/test_pliv.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/tests/test_pliv_external_predictions.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/tests/test_pliv_partial_x.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/tests/test_pliv_partial_x_tune.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/tests/test_pliv_partial_xz.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/tests/test_pliv_partial_xz_tune.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/tests/test_pliv_partial_z.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/tests/test_pliv_partial_z_tune.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/tests/test_pliv_tune.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/tests/test_plr_classifier.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/tests/test_plr_external_predictions.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/tests/test_plr_multi_treat.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/tests/test_plr_reestimate_from_scores.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/tests/test_plr_rep_cross.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/tests/test_plr_set_ml_nuisance_pars.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/tests/test_plr_set_smpls_externally.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/plm/tests/test_plr_tune.py +0 -0
- {DoubleML-0.9.0/doubleml → doubleml-0.9.2/doubleml/rdd}/tests/__init__.py +0 -0
- {DoubleML-0.9.0/doubleml/utils → doubleml-0.9.2/doubleml}/tests/__init__.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/_utils.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/_utils_boot.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/_utils_cluster.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/_utils_dml_cv_predict.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/_utils_doubleml_sensitivity_manual.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/conftest.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/test_cv_predict.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/test_datasets.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/test_evaluate_learner.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/test_exceptions.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/test_exceptions_ext_preds.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/test_framework.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/test_framework_coverage.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/test_framework_exceptions.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/test_framework_pval_corrections.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/test_framework_sensitivity.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/test_model_defaults.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/test_multiway_cluster.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/test_nonlinear_cluster.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/test_nonlinear_score_mixin.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/test_package.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/test_return_types.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/test_scores.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/test_sensitivity.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/test_sensitivity_cluster.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/test_set_ml_nuisance_params.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/tests/test_set_sample_splitting.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/utils/_descriptive.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/utils/_plots.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/utils/dummy_learners.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/utils/gain_statistics.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/utils/policytree.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/utils/resampling.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/utils/tests/_utils_pt_manual.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/utils/tests/test_dummy_learners.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/utils/tests/test_exceptions_gain_statistics.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/doubleml/utils/tests/test_policytree.py +0 -0
- {DoubleML-0.9.0 → doubleml-0.9.2}/setup.cfg +0 -0
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: DoubleML
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.2
|
|
4
4
|
Summary: Double Machine Learning in Python
|
|
5
|
-
Home-page: https://docs.doubleml.org
|
|
6
5
|
Author: Bach, P., Chernozhukov, V., Klaassen, S., Kurz, M. S., and Spindler, M.
|
|
7
|
-
Maintainer: Sven Klaassen
|
|
8
|
-
Maintainer-email: sven.klaassen@uni-hamburg.de
|
|
9
|
-
License: UNKNOWN
|
|
6
|
+
Maintainer-email: Sven Klaassen <sven.klaassen@uni-hamburg.de>
|
|
10
7
|
Project-URL: Documentation, https://docs.doubleml.org
|
|
11
|
-
Project-URL: Source
|
|
8
|
+
Project-URL: Source, https://github.com/DoubleML/doubleml-for-py
|
|
12
9
|
Project-URL: Bug Tracker, https://github.com/DoubleML/doubleml-for-py/issues
|
|
13
|
-
Platform: UNKNOWN
|
|
14
10
|
Classifier: Programming Language :: Python :: 3
|
|
15
11
|
Classifier: Programming Language :: Python :: 3.9
|
|
16
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -21,6 +17,20 @@ Classifier: Operating System :: OS Independent
|
|
|
21
17
|
Requires-Python: >=3.9
|
|
22
18
|
Description-Content-Type: text/markdown
|
|
23
19
|
License-File: LICENSE
|
|
20
|
+
Requires-Dist: joblib
|
|
21
|
+
Requires-Dist: numpy
|
|
22
|
+
Requires-Dist: pandas
|
|
23
|
+
Requires-Dist: scipy
|
|
24
|
+
Requires-Dist: scikit-learn<1.6.0,>=1.4.0
|
|
25
|
+
Requires-Dist: statsmodels
|
|
26
|
+
Requires-Dist: matplotlib
|
|
27
|
+
Requires-Dist: plotly
|
|
28
|
+
Provides-Extra: rdd
|
|
29
|
+
Requires-Dist: rdrobust>=1.3.0; extra == "rdd"
|
|
30
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: pytest; extra == "dev"
|
|
32
|
+
Requires-Dist: xgboost; extra == "dev"
|
|
33
|
+
Requires-Dist: lightgbm; extra == "dev"
|
|
24
34
|
|
|
25
35
|
# DoubleML - Double Machine Learning in Python <a href="https://docs.doubleml.org"><img src="https://raw.githubusercontent.com/DoubleML/doubleml-for-py/main/doc/logo.png" align="right" width = "120" /></a>
|
|
26
36
|
|
|
@@ -158,5 +168,3 @@ Double/debiased machine learning for treatment and structural parameters. The Ec
|
|
|
158
168
|
|
|
159
169
|
Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M. and Duchesnay, E. (2011),
|
|
160
170
|
Scikit-learn: Machine Learning in Python. Journal of Machine Learning Research, 12: 2825--2830, [https://jmlr.csail.mit.edu/papers/v12/pedregosa11a.html](https://jmlr.csail.mit.edu/papers/v12/pedregosa11a.html).
|
|
161
|
-
|
|
162
|
-
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
LICENSE
|
|
2
2
|
MANIFEST.in
|
|
3
3
|
README.md
|
|
4
|
+
pyproject.toml
|
|
4
5
|
pytest.ini
|
|
5
|
-
setup.py
|
|
6
6
|
DoubleML.egg-info/PKG-INFO
|
|
7
7
|
DoubleML.egg-info/SOURCES.txt
|
|
8
8
|
DoubleML.egg-info/dependency_links.txt
|
|
@@ -111,6 +111,26 @@ doubleml/plm/tests/test_plr_rep_cross.py
|
|
|
111
111
|
doubleml/plm/tests/test_plr_set_ml_nuisance_pars.py
|
|
112
112
|
doubleml/plm/tests/test_plr_set_smpls_externally.py
|
|
113
113
|
doubleml/plm/tests/test_plr_tune.py
|
|
114
|
+
doubleml/rdd/__init__.py
|
|
115
|
+
doubleml/rdd/_utils.py
|
|
116
|
+
doubleml/rdd/rdd.py
|
|
117
|
+
doubleml/rdd/datasets/__init__.py
|
|
118
|
+
doubleml/rdd/datasets/simple_dgp.py
|
|
119
|
+
doubleml/rdd/tests/__init__.py
|
|
120
|
+
doubleml/rdd/tests/conftest.py
|
|
121
|
+
doubleml/rdd/tests/test_rdd_classifier.py
|
|
122
|
+
doubleml/rdd/tests/test_rdd_classifier_fuzzy.py
|
|
123
|
+
doubleml/rdd/tests/test_rdd_classifier_fuzzy_left.py
|
|
124
|
+
doubleml/rdd/tests/test_rdd_classifier_fuzzy_right.py
|
|
125
|
+
doubleml/rdd/tests/test_rdd_classifier_sharp.py
|
|
126
|
+
doubleml/rdd/tests/test_rdd_default_values.py
|
|
127
|
+
doubleml/rdd/tests/test_rdd_exceptions.py
|
|
128
|
+
doubleml/rdd/tests/test_rdd_fuzzy.py
|
|
129
|
+
doubleml/rdd/tests/test_rdd_fuzzy_left.py
|
|
130
|
+
doubleml/rdd/tests/test_rdd_fuzzy_right.py
|
|
131
|
+
doubleml/rdd/tests/test_rdd_not_installed.py
|
|
132
|
+
doubleml/rdd/tests/test_rdd_return_types.py
|
|
133
|
+
doubleml/rdd/tests/test_rdd_sharp.py
|
|
114
134
|
doubleml/tests/__init__.py
|
|
115
135
|
doubleml/tests/_utils.py
|
|
116
136
|
doubleml/tests/_utils_boot.py
|
|
@@ -148,6 +168,7 @@ doubleml/utils/_plots.py
|
|
|
148
168
|
doubleml/utils/blp.py
|
|
149
169
|
doubleml/utils/dummy_learners.py
|
|
150
170
|
doubleml/utils/gain_statistics.py
|
|
171
|
+
doubleml/utils/global_learner.py
|
|
151
172
|
doubleml/utils/policytree.py
|
|
152
173
|
doubleml/utils/resampling.py
|
|
153
174
|
doubleml/utils/tests/__init__.py
|
|
@@ -156,5 +177,7 @@ doubleml/utils/tests/_utils_pt_manual.py
|
|
|
156
177
|
doubleml/utils/tests/test_blp.py
|
|
157
178
|
doubleml/utils/tests/test_dummy_learners.py
|
|
158
179
|
doubleml/utils/tests/test_exceptions_gain_statistics.py
|
|
180
|
+
doubleml/utils/tests/test_exceptions_global_learners.py
|
|
181
|
+
doubleml/utils/tests/test_global_learners.py
|
|
159
182
|
doubleml/utils/tests/test_policytree.py
|
|
160
183
|
doubleml/utils/tests/test_var_est_and_aggregation.py
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: DoubleML
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.2
|
|
4
4
|
Summary: Double Machine Learning in Python
|
|
5
|
-
Home-page: https://docs.doubleml.org
|
|
6
5
|
Author: Bach, P., Chernozhukov, V., Klaassen, S., Kurz, M. S., and Spindler, M.
|
|
7
|
-
Maintainer: Sven Klaassen
|
|
8
|
-
Maintainer-email: sven.klaassen@uni-hamburg.de
|
|
9
|
-
License: UNKNOWN
|
|
6
|
+
Maintainer-email: Sven Klaassen <sven.klaassen@uni-hamburg.de>
|
|
10
7
|
Project-URL: Documentation, https://docs.doubleml.org
|
|
11
|
-
Project-URL: Source
|
|
8
|
+
Project-URL: Source, https://github.com/DoubleML/doubleml-for-py
|
|
12
9
|
Project-URL: Bug Tracker, https://github.com/DoubleML/doubleml-for-py/issues
|
|
13
|
-
Platform: UNKNOWN
|
|
14
10
|
Classifier: Programming Language :: Python :: 3
|
|
15
11
|
Classifier: Programming Language :: Python :: 3.9
|
|
16
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -21,6 +17,20 @@ Classifier: Operating System :: OS Independent
|
|
|
21
17
|
Requires-Python: >=3.9
|
|
22
18
|
Description-Content-Type: text/markdown
|
|
23
19
|
License-File: LICENSE
|
|
20
|
+
Requires-Dist: joblib
|
|
21
|
+
Requires-Dist: numpy
|
|
22
|
+
Requires-Dist: pandas
|
|
23
|
+
Requires-Dist: scipy
|
|
24
|
+
Requires-Dist: scikit-learn<1.6.0,>=1.4.0
|
|
25
|
+
Requires-Dist: statsmodels
|
|
26
|
+
Requires-Dist: matplotlib
|
|
27
|
+
Requires-Dist: plotly
|
|
28
|
+
Provides-Extra: rdd
|
|
29
|
+
Requires-Dist: rdrobust>=1.3.0; extra == "rdd"
|
|
30
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: pytest; extra == "dev"
|
|
32
|
+
Requires-Dist: xgboost; extra == "dev"
|
|
33
|
+
Requires-Dist: lightgbm; extra == "dev"
|
|
24
34
|
|
|
25
35
|
# DoubleML - Double Machine Learning in Python <a href="https://docs.doubleml.org"><img src="https://raw.githubusercontent.com/DoubleML/doubleml-for-py/main/doc/logo.png" align="right" width = "120" /></a>
|
|
26
36
|
|
|
@@ -158,5 +168,3 @@ Double/debiased machine learning for treatment and structural parameters. The Ec
|
|
|
158
168
|
|
|
159
169
|
Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M. and Duchesnay, E. (2011),
|
|
160
170
|
Scikit-learn: Machine Learning in Python. Journal of Machine Learning Research, 12: 2825--2830, [https://jmlr.csail.mit.edu/papers/v12/pedregosa11a.html](https://jmlr.csail.mit.edu/papers/v12/pedregosa11a.html).
|
|
161
|
-
|
|
162
|
-
|
|
@@ -110,7 +110,7 @@ class DoubleMLData(DoubleMLBaseData):
|
|
|
110
110
|
Default is ``None``.
|
|
111
111
|
|
|
112
112
|
s_col : None or str
|
|
113
|
-
The selection variable (only relevant/used for SSM Estimatiors).
|
|
113
|
+
The score or selection variable (only relevant/used for RDD or SSM Estimatiors).
|
|
114
114
|
Default is ``None``.
|
|
115
115
|
|
|
116
116
|
use_other_treat_as_covariate : bool
|
|
@@ -182,7 +182,7 @@ class DoubleMLData(DoubleMLBaseData):
|
|
|
182
182
|
if self.t_col is not None:
|
|
183
183
|
data_summary += f'Time variable: {self.t_col}\n'
|
|
184
184
|
if self.s_col is not None:
|
|
185
|
-
data_summary += f'Selection variable: {self.s_col}\n'
|
|
185
|
+
data_summary += f'Score/Selection variable: {self.s_col}\n'
|
|
186
186
|
data_summary += f'No. Observations: {self.n_obs}\n'
|
|
187
187
|
return data_summary
|
|
188
188
|
|
|
@@ -212,7 +212,7 @@ class DoubleMLData(DoubleMLBaseData):
|
|
|
212
212
|
Default is ``None``.
|
|
213
213
|
|
|
214
214
|
s : :class:`numpy.ndarray`
|
|
215
|
-
Array of the selection variable (only relevant/used for SSM models).
|
|
215
|
+
Array of the score or selection variable (only relevant/used for RDD and SSM models).
|
|
216
216
|
Default is ``None``.
|
|
217
217
|
|
|
218
218
|
use_other_treat_as_covariate : bool
|
|
@@ -351,7 +351,7 @@ class DoubleMLData(DoubleMLBaseData):
|
|
|
351
351
|
@property
|
|
352
352
|
def s(self):
|
|
353
353
|
"""
|
|
354
|
-
Array of selection variable.
|
|
354
|
+
Array of score or selection variable.
|
|
355
355
|
"""
|
|
356
356
|
if self.s_col is not None:
|
|
357
357
|
return self._s.values
|
|
@@ -538,7 +538,7 @@ class DoubleMLData(DoubleMLBaseData):
|
|
|
538
538
|
@property
|
|
539
539
|
def s_col(self):
|
|
540
540
|
"""
|
|
541
|
-
The selection variable.
|
|
541
|
+
The score or selection variable.
|
|
542
542
|
"""
|
|
543
543
|
return self._s_col
|
|
544
544
|
|
|
@@ -547,10 +547,10 @@ class DoubleMLData(DoubleMLBaseData):
|
|
|
547
547
|
reset_value = hasattr(self, '_s_col')
|
|
548
548
|
if value is not None:
|
|
549
549
|
if not isinstance(value, str):
|
|
550
|
-
raise TypeError('The selection variable s_col must be of str type (or None). '
|
|
550
|
+
raise TypeError('The score or selection variable s_col must be of str type (or None). '
|
|
551
551
|
f'{str(value)} of type {str(type(value))} was passed.')
|
|
552
552
|
if value not in self.all_variables:
|
|
553
|
-
raise ValueError('Invalid selection variable s_col. '
|
|
553
|
+
raise ValueError('Invalid score or selection variable s_col. '
|
|
554
554
|
f'{value} is no data column.')
|
|
555
555
|
self._s_col = value
|
|
556
556
|
else:
|
|
@@ -725,24 +725,24 @@ class DoubleMLData(DoubleMLBaseData):
|
|
|
725
725
|
if self.s_col is not None:
|
|
726
726
|
s_col_set = {self.s_col}
|
|
727
727
|
if not s_col_set.isdisjoint(x_cols_set):
|
|
728
|
-
raise ValueError(f'{str(self.s_col)} cannot be set as selection variable ``s_col`` and covariate in '
|
|
728
|
+
raise ValueError(f'{str(self.s_col)} cannot be set as score or selection variable ``s_col`` and covariate in '
|
|
729
729
|
'``x_cols``.')
|
|
730
730
|
if not s_col_set.isdisjoint(d_cols_set):
|
|
731
|
-
raise ValueError(f'{str(self.s_col)} cannot be set as selection variable ``s_col`` and treatment
|
|
732
|
-
'``d_cols``.')
|
|
731
|
+
raise ValueError(f'{str(self.s_col)} cannot be set as score or selection variable ``s_col`` and treatment '
|
|
732
|
+
'variable in ``d_cols``.')
|
|
733
733
|
if not s_col_set.isdisjoint(y_col_set):
|
|
734
|
-
raise ValueError(f'{str(self.s_col)} cannot be set as selection variable ``s_col`` and outcome
|
|
735
|
-
'``y_col``.')
|
|
734
|
+
raise ValueError(f'{str(self.s_col)} cannot be set as score or selection variable ``s_col`` and outcome '
|
|
735
|
+
'variable ``y_col``.')
|
|
736
736
|
if self.z_cols is not None:
|
|
737
737
|
z_cols_set = set(self.z_cols)
|
|
738
738
|
if not s_col_set.isdisjoint(z_cols_set):
|
|
739
|
-
raise ValueError(f'{str(self.s_col)} cannot be set as selection variable ``s_col`` and
|
|
740
|
-
'variable in ``z_cols``.')
|
|
739
|
+
raise ValueError(f'{str(self.s_col)} cannot be set as score or selection variable ``s_col`` and '
|
|
740
|
+
'instrumental variable in ``z_cols``.')
|
|
741
741
|
if self.t_col is not None:
|
|
742
742
|
t_col_set = {self.t_col}
|
|
743
743
|
if not s_col_set.isdisjoint(t_col_set):
|
|
744
|
-
raise ValueError(f'{str(self.s_col)} cannot be set as selection variable ``s_col`` and time
|
|
745
|
-
'``t_col``.')
|
|
744
|
+
raise ValueError(f'{str(self.s_col)} cannot be set as score or selection variable ``s_col`` and time '
|
|
745
|
+
'variable ``t_col``.')
|
|
746
746
|
|
|
747
747
|
|
|
748
748
|
class DoubleMLClusterData(DoubleMLData):
|
|
@@ -780,7 +780,7 @@ class DoubleMLClusterData(DoubleMLData):
|
|
|
780
780
|
Default is ``None``.
|
|
781
781
|
|
|
782
782
|
s_col : None or str
|
|
783
|
-
The selection variable (only relevant/used for SSM Estimatiors).
|
|
783
|
+
The score or selection variable (only relevant/used for RDD and SSM Estimatiors).
|
|
784
784
|
Default is ``None``.
|
|
785
785
|
|
|
786
786
|
use_other_treat_as_covariate : bool
|
|
@@ -854,7 +854,7 @@ class DoubleMLClusterData(DoubleMLData):
|
|
|
854
854
|
if self.t_col is not None:
|
|
855
855
|
data_summary += f'Time variable: {self.t_col}\n'
|
|
856
856
|
if self.s_col is not None:
|
|
857
|
-
data_summary += f'Selection variable: {self.s_col}\n'
|
|
857
|
+
data_summary += f'Score/Selection variable: {self.s_col}\n'
|
|
858
858
|
|
|
859
859
|
data_summary += f'No. Observations: {self.n_obs}\n'
|
|
860
860
|
return data_summary
|
|
@@ -888,7 +888,7 @@ class DoubleMLClusterData(DoubleMLData):
|
|
|
888
888
|
Default is ``None``.
|
|
889
889
|
|
|
890
890
|
s : :class:`numpy.ndarray`
|
|
891
|
-
Array of the selection variable (only relevant/used for SSM models).
|
|
891
|
+
Array of the score or selection variable (only relevant/used for RDD or SSM models).
|
|
892
892
|
Default is ``None``.
|
|
893
893
|
|
|
894
894
|
use_other_treat_as_covariate : bool
|
|
@@ -1039,7 +1039,7 @@ class DoubleMLClusterData(DoubleMLData):
|
|
|
1039
1039
|
'cluster variable in ``cluster_cols``.')
|
|
1040
1040
|
if self.s_col is not None:
|
|
1041
1041
|
if not s_col_set.isdisjoint(cluster_cols_set):
|
|
1042
|
-
raise ValueError(f'{str(self.s_col)} cannot be set as selection variable ``s_col`` and '
|
|
1042
|
+
raise ValueError(f'{str(self.s_col)} cannot be set as score or selection variable ``s_col`` and '
|
|
1043
1043
|
'cluster variable in ``cluster_cols``.')
|
|
1044
1044
|
|
|
1045
1045
|
def _set_cluster_vars(self):
|
|
@@ -389,7 +389,7 @@ class DoubleMLAPO(LinearScoreMixin, DoubleML):
|
|
|
389
389
|
|
|
390
390
|
return
|
|
391
391
|
|
|
392
|
-
def capo(self, basis, is_gate=False):
|
|
392
|
+
def capo(self, basis, is_gate=False, **kwargs):
|
|
393
393
|
"""
|
|
394
394
|
Calculate conditional average potential outcomes (CAPO) for a given basis.
|
|
395
395
|
|
|
@@ -398,10 +398,14 @@ class DoubleMLAPO(LinearScoreMixin, DoubleML):
|
|
|
398
398
|
basis : :class:`pandas.DataFrame`
|
|
399
399
|
The basis for estimating the best linear predictor. Has to have the shape ``(n_obs, d)``,
|
|
400
400
|
where ``n_obs`` is the number of observations and ``d`` is the number of predictors.
|
|
401
|
+
|
|
401
402
|
is_gate : bool
|
|
402
403
|
Indicates whether the basis is constructed for GATE/GAPOs (dummy-basis).
|
|
403
404
|
Default is ``False``.
|
|
404
405
|
|
|
406
|
+
**kwargs: dict
|
|
407
|
+
Additional keyword arguments to be passed to :meth:`statsmodels.regression.linear_model.OLS.fit` e.g. ``cov_type``.
|
|
408
|
+
|
|
405
409
|
Returns
|
|
406
410
|
-------
|
|
407
411
|
model : :class:`doubleML.DoubleMLBLP`
|
|
@@ -420,10 +424,10 @@ class DoubleMLAPO(LinearScoreMixin, DoubleML):
|
|
|
420
424
|
orth_signal = self.psi_elements['psi_b'].reshape(-1)
|
|
421
425
|
# fit the best linear predictor
|
|
422
426
|
model = DoubleMLBLP(orth_signal, basis=basis, is_gate=is_gate)
|
|
423
|
-
model.fit()
|
|
427
|
+
model.fit(**kwargs)
|
|
424
428
|
return model
|
|
425
429
|
|
|
426
|
-
def gapo(self, groups):
|
|
430
|
+
def gapo(self, groups, **kwargs):
|
|
427
431
|
"""
|
|
428
432
|
Calculate group average potential outcomes (GAPO) for groups.
|
|
429
433
|
|
|
@@ -434,6 +438,9 @@ class DoubleMLAPO(LinearScoreMixin, DoubleML):
|
|
|
434
438
|
Has to be dummy coded with shape ``(n_obs, d)``, where ``n_obs`` is the number of observations
|
|
435
439
|
and ``d`` is the number of groups or ``(n_obs, 1)`` and contain the corresponding groups (as str).
|
|
436
440
|
|
|
441
|
+
**kwargs: dict
|
|
442
|
+
Additional keyword arguments to be passed to :meth:`statsmodels.regression.linear_model.OLS.fit` e.g. ``cov_type``.
|
|
443
|
+
|
|
437
444
|
Returns
|
|
438
445
|
-------
|
|
439
446
|
model : :class:`doubleML.DoubleMLBLP`
|
|
@@ -453,5 +460,5 @@ class DoubleMLAPO(LinearScoreMixin, DoubleML):
|
|
|
453
460
|
if any(groups.sum(0) <= 5):
|
|
454
461
|
warnings.warn('At least one group effect is estimated with less than 6 observations.')
|
|
455
462
|
|
|
456
|
-
model = self.capo(groups, is_gate=True)
|
|
463
|
+
model = self.capo(groups, is_gate=True, **kwargs)
|
|
457
464
|
return model
|
|
@@ -431,7 +431,7 @@ class DoubleMLIRM(LinearScoreMixin, DoubleML):
|
|
|
431
431
|
|
|
432
432
|
return res
|
|
433
433
|
|
|
434
|
-
def cate(self, basis, is_gate=False):
|
|
434
|
+
def cate(self, basis, is_gate=False, **kwargs):
|
|
435
435
|
"""
|
|
436
436
|
Calculate conditional average treatment effects (CATE) for a given basis.
|
|
437
437
|
|
|
@@ -440,10 +440,14 @@ class DoubleMLIRM(LinearScoreMixin, DoubleML):
|
|
|
440
440
|
basis : :class:`pandas.DataFrame`
|
|
441
441
|
The basis for estimating the best linear predictor. Has to have the shape ``(n_obs, d)``,
|
|
442
442
|
where ``n_obs`` is the number of observations and ``d`` is the number of predictors.
|
|
443
|
+
|
|
443
444
|
is_gate : bool
|
|
444
445
|
Indicates whether the basis is constructed for GATEs (dummy-basis).
|
|
445
446
|
Default is ``False``.
|
|
446
447
|
|
|
448
|
+
**kwargs: dict
|
|
449
|
+
Additional keyword arguments to be passed to :meth:`statsmodels.regression.linear_model.OLS.fit` e.g. ``cov_type``.
|
|
450
|
+
|
|
447
451
|
Returns
|
|
448
452
|
-------
|
|
449
453
|
model : :class:`doubleML.DoubleMLBLP`
|
|
@@ -462,10 +466,10 @@ class DoubleMLIRM(LinearScoreMixin, DoubleML):
|
|
|
462
466
|
orth_signal = self.psi_elements['psi_b'].reshape(-1)
|
|
463
467
|
# fit the best linear predictor
|
|
464
468
|
model = DoubleMLBLP(orth_signal, basis=basis, is_gate=is_gate)
|
|
465
|
-
model.fit()
|
|
469
|
+
model.fit(**kwargs)
|
|
466
470
|
return model
|
|
467
471
|
|
|
468
|
-
def gate(self, groups):
|
|
472
|
+
def gate(self, groups, **kwargs):
|
|
469
473
|
"""
|
|
470
474
|
Calculate group average treatment effects (GATE) for groups.
|
|
471
475
|
|
|
@@ -476,6 +480,9 @@ class DoubleMLIRM(LinearScoreMixin, DoubleML):
|
|
|
476
480
|
Has to be dummy coded with shape ``(n_obs, d)``, where ``n_obs`` is the number of observations
|
|
477
481
|
and ``d`` is the number of groups or ``(n_obs, 1)`` and contain the corresponding groups (as str).
|
|
478
482
|
|
|
483
|
+
**kwargs: dict
|
|
484
|
+
Additional keyword arguments to be passed to :meth:`statsmodels.regression.linear_model.OLS.fit` e.g. ``cov_type``.
|
|
485
|
+
|
|
479
486
|
Returns
|
|
480
487
|
-------
|
|
481
488
|
model : :class:`doubleML.DoubleMLBLP`
|
|
@@ -495,7 +502,7 @@ class DoubleMLIRM(LinearScoreMixin, DoubleML):
|
|
|
495
502
|
if any(groups.sum(0) <= 5):
|
|
496
503
|
warnings.warn('At least one group effect is estimated with less than 6 observations.')
|
|
497
504
|
|
|
498
|
-
model = self.cate(groups, is_gate=True)
|
|
505
|
+
model = self.cate(groups, is_gate=True, **kwargs)
|
|
499
506
|
return model
|
|
500
507
|
|
|
501
508
|
def policy_tree(self, features, depth=2, **tree_params):
|
|
@@ -200,8 +200,14 @@ def test_dml_apo_sensitivity(dml_apo_fixture):
|
|
|
200
200
|
rtol=1e-9, atol=1e-4)
|
|
201
201
|
|
|
202
202
|
|
|
203
|
+
@pytest.fixture(scope='module',
|
|
204
|
+
params=["nonrobust", "HC0", "HC1", "HC2", "HC3"])
|
|
205
|
+
def cov_type(request):
|
|
206
|
+
return request.param
|
|
207
|
+
|
|
208
|
+
|
|
203
209
|
@pytest.mark.ci
|
|
204
|
-
def test_dml_apo_capo_gapo(treatment_level):
|
|
210
|
+
def test_dml_apo_capo_gapo(treatment_level, cov_type):
|
|
205
211
|
n = 20
|
|
206
212
|
# collect data
|
|
207
213
|
np.random.seed(42)
|
|
@@ -221,25 +227,28 @@ def test_dml_apo_capo_gapo(treatment_level):
|
|
|
221
227
|
dml_obj.fit()
|
|
222
228
|
# create a random basis
|
|
223
229
|
random_basis = pd.DataFrame(np.random.normal(0, 1, size=(n, 5)))
|
|
224
|
-
capo = dml_obj.capo(random_basis)
|
|
230
|
+
capo = dml_obj.capo(random_basis, cov_type=cov_type)
|
|
225
231
|
assert isinstance(capo, dml.utils.blp.DoubleMLBLP)
|
|
226
232
|
assert isinstance(capo.confint(), pd.DataFrame)
|
|
233
|
+
assert capo.blp_model.cov_type == cov_type
|
|
227
234
|
|
|
228
235
|
groups_1 = pd.DataFrame(np.column_stack([obj_dml_data.data['X1'] <= -1.0,
|
|
229
236
|
obj_dml_data.data['X1'] > 0.2]),
|
|
230
237
|
columns=['Group 1', 'Group 2'])
|
|
231
238
|
msg = ('At least one group effect is estimated with less than 6 observations.')
|
|
232
239
|
with pytest.warns(UserWarning, match=msg):
|
|
233
|
-
gapo_1 = dml_obj.gapo(groups_1)
|
|
240
|
+
gapo_1 = dml_obj.gapo(groups_1, cov_type=cov_type)
|
|
234
241
|
assert isinstance(gapo_1, dml.utils.blp.DoubleMLBLP)
|
|
235
242
|
assert isinstance(gapo_1.confint(), pd.DataFrame)
|
|
236
243
|
assert all(gapo_1.confint().index == groups_1.columns.to_list())
|
|
244
|
+
assert gapo_1.blp_model.cov_type == cov_type
|
|
237
245
|
|
|
238
246
|
np.random.seed(42)
|
|
239
247
|
groups_2 = pd.DataFrame(np.random.choice(["1", "2"], n, p=[0.1, 0.9]))
|
|
240
248
|
msg = ('At least one group effect is estimated with less than 6 observations.')
|
|
241
249
|
with pytest.warns(UserWarning, match=msg):
|
|
242
|
-
gapo_2 = dml_obj.gapo(groups_2)
|
|
250
|
+
gapo_2 = dml_obj.gapo(groups_2, cov_type=cov_type)
|
|
243
251
|
assert isinstance(gapo_2, dml.utils.blp.DoubleMLBLP)
|
|
244
252
|
assert isinstance(gapo_2.confint(), pd.DataFrame)
|
|
245
253
|
assert all(gapo_2.confint().index == ["Group_1", "Group_2"])
|
|
254
|
+
assert gapo_2.blp_model.cov_type == cov_type
|
|
@@ -187,8 +187,14 @@ def test_dml_irm_sensitivity_rho0(dml_irm_fixture):
|
|
|
187
187
|
rtol=1e-9, atol=1e-4)
|
|
188
188
|
|
|
189
189
|
|
|
190
|
+
@pytest.fixture(scope='module',
|
|
191
|
+
params=["nonrobust", "HC0", "HC1", "HC2", "HC3"])
|
|
192
|
+
def cov_type(request):
|
|
193
|
+
return request.param
|
|
194
|
+
|
|
195
|
+
|
|
190
196
|
@pytest.mark.ci
|
|
191
|
-
def test_dml_irm_cate_gate():
|
|
197
|
+
def test_dml_irm_cate_gate(cov_type):
|
|
192
198
|
n = 9
|
|
193
199
|
# collect data
|
|
194
200
|
np.random.seed(42)
|
|
@@ -207,28 +213,31 @@ def test_dml_irm_cate_gate():
|
|
|
207
213
|
dml_irm_obj.fit()
|
|
208
214
|
# create a random basis
|
|
209
215
|
random_basis = pd.DataFrame(np.random.normal(0, 1, size=(n, 5)))
|
|
210
|
-
cate = dml_irm_obj.cate(random_basis)
|
|
216
|
+
cate = dml_irm_obj.cate(random_basis, cov_type=cov_type)
|
|
211
217
|
assert isinstance(cate, dml.utils.blp.DoubleMLBLP)
|
|
212
218
|
assert isinstance(cate.confint(), pd.DataFrame)
|
|
219
|
+
assert cate.blp_model.cov_type == cov_type
|
|
213
220
|
|
|
214
221
|
groups_1 = pd.DataFrame(np.column_stack([obj_dml_data.data['X1'] <= 0,
|
|
215
222
|
obj_dml_data.data['X1'] > 0.2]),
|
|
216
223
|
columns=['Group 1', 'Group 2'])
|
|
217
224
|
msg = ('At least one group effect is estimated with less than 6 observations.')
|
|
218
225
|
with pytest.warns(UserWarning, match=msg):
|
|
219
|
-
gate_1 = dml_irm_obj.gate(groups_1)
|
|
226
|
+
gate_1 = dml_irm_obj.gate(groups_1, cov_type=cov_type)
|
|
220
227
|
assert isinstance(gate_1, dml.utils.blp.DoubleMLBLP)
|
|
221
228
|
assert isinstance(gate_1.confint(), pd.DataFrame)
|
|
222
229
|
assert all(gate_1.confint().index == groups_1.columns.to_list())
|
|
230
|
+
assert gate_1.blp_model.cov_type == cov_type
|
|
223
231
|
|
|
224
232
|
np.random.seed(42)
|
|
225
233
|
groups_2 = pd.DataFrame(np.random.choice(["1", "2"], n))
|
|
226
234
|
msg = ('At least one group effect is estimated with less than 6 observations.')
|
|
227
235
|
with pytest.warns(UserWarning, match=msg):
|
|
228
|
-
gate_2 = dml_irm_obj.gate(groups_2)
|
|
236
|
+
gate_2 = dml_irm_obj.gate(groups_2, cov_type=cov_type)
|
|
229
237
|
assert isinstance(gate_2, dml.utils.blp.DoubleMLBLP)
|
|
230
238
|
assert isinstance(gate_2.confint(), pd.DataFrame)
|
|
231
239
|
assert all(gate_2.confint().index == ["Group_1", "Group_2"])
|
|
240
|
+
assert gate_2.blp_model.cov_type == cov_type
|
|
232
241
|
|
|
233
242
|
|
|
234
243
|
@pytest.fixture(scope='module',
|
|
@@ -341,7 +341,7 @@ class DoubleMLPLR(LinearScoreMixin, DoubleML):
|
|
|
341
341
|
|
|
342
342
|
return res
|
|
343
343
|
|
|
344
|
-
def cate(self, basis, is_gate=False):
|
|
344
|
+
def cate(self, basis, is_gate=False, **kwargs):
|
|
345
345
|
"""
|
|
346
346
|
Calculate conditional average treatment effects (CATE) for a given basis.
|
|
347
347
|
|
|
@@ -350,10 +350,14 @@ class DoubleMLPLR(LinearScoreMixin, DoubleML):
|
|
|
350
350
|
basis : :class:`pandas.DataFrame`
|
|
351
351
|
The basis for estimating the best linear predictor. Has to have the shape ``(n_obs, d)``,
|
|
352
352
|
where ``n_obs`` is the number of observations and ``d`` is the number of predictors.
|
|
353
|
+
|
|
353
354
|
is_gate : bool
|
|
354
355
|
Indicates whether the basis is constructed for GATEs (dummy-basis).
|
|
355
356
|
Default is ``False``.
|
|
356
357
|
|
|
358
|
+
**kwargs: dict
|
|
359
|
+
Additional keyword arguments to be passed to :meth:`statsmodels.regression.linear_model.OLS.fit` e.g. ``cov_type``.
|
|
360
|
+
|
|
357
361
|
Returns
|
|
358
362
|
-------
|
|
359
363
|
model : :class:`doubleML.DoubleMLBLP`
|
|
@@ -374,10 +378,10 @@ class DoubleMLPLR(LinearScoreMixin, DoubleML):
|
|
|
374
378
|
basis=D_basis,
|
|
375
379
|
is_gate=is_gate,
|
|
376
380
|
)
|
|
377
|
-
model.fit()
|
|
381
|
+
model.fit(**kwargs)
|
|
378
382
|
return model
|
|
379
383
|
|
|
380
|
-
def gate(self, groups):
|
|
384
|
+
def gate(self, groups, **kwargs):
|
|
381
385
|
"""
|
|
382
386
|
Calculate group average treatment effects (GATE) for groups.
|
|
383
387
|
|
|
@@ -388,6 +392,9 @@ class DoubleMLPLR(LinearScoreMixin, DoubleML):
|
|
|
388
392
|
Has to be dummy coded with shape ``(n_obs, d)``, where ``n_obs`` is the number of observations
|
|
389
393
|
and ``d`` is the number of groups or ``(n_obs, 1)`` and contain the corresponding groups (as str).
|
|
390
394
|
|
|
395
|
+
**kwargs: dict
|
|
396
|
+
Additional keyword arguments to be passed to :meth:`statsmodels.regression.linear_model.OLS.fit` e.g. ``cov_type``.
|
|
397
|
+
|
|
391
398
|
Returns
|
|
392
399
|
-------
|
|
393
400
|
model : :class:`doubleML.DoubleMLBLP`
|
|
@@ -407,7 +414,7 @@ class DoubleMLPLR(LinearScoreMixin, DoubleML):
|
|
|
407
414
|
if any(groups.sum(0) <= 5):
|
|
408
415
|
warnings.warn('At least one group effect is estimated with less than 6 observations.')
|
|
409
416
|
|
|
410
|
-
model = self.cate(groups, is_gate=True)
|
|
417
|
+
model = self.cate(groups, is_gate=True, **kwargs)
|
|
411
418
|
return model
|
|
412
419
|
|
|
413
420
|
def _partial_out(self):
|
|
@@ -301,8 +301,14 @@ def test_dml_plr_ols_manual_boot(dml_plr_ols_manual_fixture):
|
|
|
301
301
|
rtol=1e-9, atol=1e-4)
|
|
302
302
|
|
|
303
303
|
|
|
304
|
+
@pytest.fixture(scope='module',
|
|
305
|
+
params=["nonrobust", "HC0", "HC1", "HC2", "HC3"])
|
|
306
|
+
def cov_type(request):
|
|
307
|
+
return request.param
|
|
308
|
+
|
|
309
|
+
|
|
304
310
|
@pytest.mark.ci
|
|
305
|
-
def test_dml_plr_cate_gate(score):
|
|
311
|
+
def test_dml_plr_cate_gate(score, cov_type):
|
|
306
312
|
n = 9
|
|
307
313
|
|
|
308
314
|
# collect data
|
|
@@ -318,9 +324,10 @@ def test_dml_plr_cate_gate(score):
|
|
|
318
324
|
score=score)
|
|
319
325
|
dml_plr_obj.fit()
|
|
320
326
|
random_basis = pd.DataFrame(np.random.normal(0, 1, size=(n, 5)))
|
|
321
|
-
cate = dml_plr_obj.cate(random_basis)
|
|
327
|
+
cate = dml_plr_obj.cate(random_basis, cov_type=cov_type)
|
|
322
328
|
assert isinstance(cate, dml.DoubleMLBLP)
|
|
323
329
|
assert isinstance(cate.confint(), pd.DataFrame)
|
|
330
|
+
assert cate.blp_model.cov_type == cov_type
|
|
324
331
|
|
|
325
332
|
groups_1 = pd.DataFrame(
|
|
326
333
|
np.column_stack([obj_dml_data.data['X1'] <= 0,
|
|
@@ -328,16 +335,18 @@ def test_dml_plr_cate_gate(score):
|
|
|
328
335
|
columns=['Group 1', 'Group 2'])
|
|
329
336
|
msg = ('At least one group effect is estimated with less than 6 observations.')
|
|
330
337
|
with pytest.warns(UserWarning, match=msg):
|
|
331
|
-
gate_1 = dml_plr_obj.gate(groups_1)
|
|
338
|
+
gate_1 = dml_plr_obj.gate(groups_1, cov_type=cov_type)
|
|
332
339
|
assert isinstance(gate_1, dml.utils.blp.DoubleMLBLP)
|
|
333
340
|
assert isinstance(gate_1.confint(), pd.DataFrame)
|
|
334
341
|
assert all(gate_1.confint().index == groups_1.columns.tolist())
|
|
342
|
+
assert gate_1.blp_model.cov_type == cov_type
|
|
335
343
|
|
|
336
344
|
np.random.seed(42)
|
|
337
345
|
groups_2 = pd.DataFrame(np.random.choice(["1", "2"], n))
|
|
338
346
|
msg = ('At least one group effect is estimated with less than 6 observations.')
|
|
339
347
|
with pytest.warns(UserWarning, match=msg):
|
|
340
|
-
gate_2 = dml_plr_obj.gate(groups_2)
|
|
348
|
+
gate_2 = dml_plr_obj.gate(groups_2, cov_type=cov_type)
|
|
341
349
|
assert isinstance(gate_2, dml.utils.blp.DoubleMLBLP)
|
|
342
350
|
assert isinstance(gate_2.confint(), pd.DataFrame)
|
|
343
351
|
assert all(gate_2.confint().index == ["Group_1", "Group_2"])
|
|
352
|
+
assert gate_2.blp_model.cov_type == cov_type
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import importlib
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def _is_rdrobust_available():
|
|
5
|
+
try:
|
|
6
|
+
rdrobust = importlib.import_module("rdrobust")
|
|
7
|
+
return rdrobust
|
|
8
|
+
except ImportError:
|
|
9
|
+
msg = (
|
|
10
|
+
"rdrobust is not installed. "
|
|
11
|
+
"Please install it using 'pip install DoubleML[rdd]'")
|
|
12
|
+
raise ImportError(msg)
|