Merge pull request #732 from py-why/fix/dowhy_functional_api_notebook_data_generation

Set seed on data generation for deterministic test
This commit is contained in:
Andres Morales 2022-11-01 09:16:07 -06:00 коммит произвёл GitHub
Родитель b9bab69d73 dcb4d54fd8
Коммит 68f5d2b1bc
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 11 добавлений и 4 удалений

Просмотреть файл

@ -88,6 +88,12 @@
" },\n",
"}\n",
"\n",
"\n",
"# set random seed for deterministic dataset generation \n",
"# and avoid problems when running tests\n",
"import numpy as np\n",
"np.random.seed(1)\n",
"\n",
"logging.config.dictConfig(DEFAULT_LOGGING)\n",
"# Disabling warnings output\n",
"import warnings\n",
@ -306,10 +312,10 @@
"outputs": [],
"source": [
"estimate_causal_model_api = causal_model.estimate_effect(\n",
" identified_estimand, method_name=\"backdoor.propensity_score_matching\"\n",
" identified_estimand_causal_model_api, method_name=\"backdoor.propensity_score_matching\"\n",
")\n",
"\n",
"print(estimate)"
"print(estimate_causal_model_api)"
]
},
{
@ -325,12 +331,13 @@
"metadata": {},
"outputs": [],
"source": [
"bootstrap_refutation_causal_model_api = causal_model.refute_estimate(identified_estimand, estimate, \"bootstrap_refuter\")\n",
"bootstrap_refutation_causal_model_api = causal_model.refute_estimate(identified_estimand_causal_model_api, estimate_causal_model_api, \"bootstrap_refuter\")\n",
"print(bootstrap_refutation_causal_model_api)\n",
"\n",
"data_subset_refutation_causal_model_api = causal_model.refute_estimate(\n",
" identified_estimand, estimate, \"data_subset_refuter\"\n",
" identified_estimand_causal_model_api, estimate_causal_model_api, \"data_subset_refuter\"\n",
")\n",
"\n",
"print(data_subset_refutation_causal_model_api)"
]
},