actableai.causal.exposure.inference package

Submodules

actableai.causal.exposure.inference.causal_graph module

actableai.causal.exposure.inference.causal_graph.create_gml_model_specs(treatment_specs: List[actableai.causal.exposure.model.estimate_effect_models.TreatmentSpec], outcome_specs: List[actableai.causal.exposure.model.estimate_effect_models.OutcomeSpec], model_specs: List[actableai.causal.exposure.model.estimate_effect_models.ModelSpec]) List[actableai.causal.exposure.model.estimate_effect_models.CausalGraphModelSpec]

Generate gml causal graphs for all model types in the model specs (e.g. maximum, intermediate, minimum, and unadjusted models)

actableai.causal.exposure.inference.confidence_interval module

actableai.causal.exposure.inference.covariate_balance module

actableai.causal.exposure.inference.estimate_effect module

actableai.causal.exposure.inference.estimator module

class actableai.causal.exposure.inference.estimator.CausalEstimator(classifier=None, regressor=None, parallelism=False)

Bases: object

Create estimator configurations for a given estimator method using a format expected by DoWhy

config_default(estimator_spec: Dict) Dict

Default setting with no configurations

config_double_machine_learning(estimator_spec: Dict) Dict

Config parameters for Linear/Forest Double Machine Learning

config_doubly_robust(estimator_spec: Dict) Dict

Config parameters for Linear/Forest Doubly Robust Learner

config_estimator(estimator_spec: Dict) Dict
config_forest_double_machine_learning(estimator_spec: Dict) Dict
config_forest_doubly_robust(estimator_spec: Dict) Dict
config_propensity_matching(estimator_spec: Dict) Dict

Config parameters for Propensity Score Matching

config_propensity_stratification(estimator_spec: Dict) Dict

Config parameters for Propensity Score Stratification Number of strata is auto-selected within DoWhy

config_propensity_weighting(estimator_spec: Dict) Dict

Config parameters for Inverse Propensity Weighting

tune_classifier_model(identified_estimand, causal_model)

Tune hyperparameters for propensity model

tune_dml_regressor_model(identified_estimand, causal_model)

Tune hyperparameters for first stage regressor model for Double ML model

tune_dr_regressor_model(identified_estimand, causal_model)

Tune hyperparameters for first stage regressor model for doubly robust learner

actableai.causal.exposure.inference.identify_estimand module

actableai.causal.exposure.inference.identify_estimand.identify_estimand(causal_graph, dataframe, treatment, outcome, controls)

actableai.causal.exposure.inference.refutation module

actableai.causal.exposure.inference.refutation.add_unobserved_common_cause(model: dowhy.causal_model.CausalModel, identified_estimand: dowhy.causal_identifier.IdentifiedEstimand, estimate: dowhy.causal_estimator.CausalEstimate, num_simulations: int = 100, **kwargs) int

Simulate a common cause that is correlated with the treatment and outcome. The test fails if the new estimate changes sign

compared to the original estimate
This test requires domain knowledge to set plausible effect strengths for
simulating unobserved confounders
actableai.causal.exposure.inference.refutation.bootstrap_refuter(model: dowhy.causal_model.CausalModel, identified_estimand: dowhy.causal_identifier.IdentifiedEstimand, estimate: dowhy.causal_estimator.CausalEstimate, num_simulations: int = 100, **kwargs) int

Replace the given dataset with a bootstrapped sample of the dataset. Use p-value as pass/fail criterion.

actableai.causal.exposure.inference.refutation.check_p_value(p_value: float, p_threshold: float = 0.05) int

Helper function to check if the returned p_value passes the given threshold

actableai.causal.exposure.inference.refutation.check_sign_change(new_effect, original_estimate) int
Helper function to co check if the new effects change sign
(e.g., negative -> positive or vice versal)

compared to the original effect

actableai.causal.exposure.inference.refutation.data_subset_refuter(model: dowhy.causal_model.CausalModel, identified_estimand: dowhy.causal_identifier.IdentifiedEstimand, estimate: dowhy.causal_estimator.CausalEstimate, num_simulations: int = 100, **kwargs) int

Replace the given subset with a randomly selected subset. Use p-value as pass/fail criterion.

actableai.causal.exposure.inference.refutation.get_tasks(num_simulations_map, estimate_effects_results, refuters)
actableai.causal.exposure.inference.refutation.placebo_treatment_refuter(model: dowhy.causal_model.CausalModel, identified_estimand: dowhy.causal_identifier.IdentifiedEstimand, estimate: dowhy.causal_estimator.CausalEstimate, num_simulations: int = 100, **kwargs) int

Replace treatment with a random independent variable. Use p-value as pass/fail criterion.

actableai.causal.exposure.inference.refutation.random_common_cause(model: dowhy.causal_model.CausalModel, identified_estimand: dowhy.causal_identifier.IdentifiedEstimand, estimate: dowhy.causal_estimator.CausalEstimate, num_simulations: int = 100, **kwargs) int

Add white noise variable as a random common cause. Use p-value as pass/fail criterion.

actableai.causal.exposure.inference.refutation.refute_estimate(spec: actableai.causal.exposure.model.refute_estimate_models.RefuterSpec)

actableai.causal.exposure.inference.significance_test module

actableai.causal.exposure.inference.significance_test.compute_null_effect(specifications)
actableai.causal.exposure.inference.significance_test.get_propensity_scores(identified_estimand, causal_model, estimate)

actableai.causal.exposure.inference.specification_interpreter module

actableai.causal.exposure.inference.specification_interpreter.get_tasks(estimate_effect_results)
actableai.causal.exposure.inference.specification_interpreter.interpret(spec_results: pandas.core.frame.DataFrame, spec_features: List, estimated_effect_col: str = 'estimated_effect') pandas.core.frame.DataFrame

Module contents