causal_falsify.algorithms.mint module
- class causal_falsify.algorithms.mint.MINT(feature_representation='linear', feature_representation_params={}, binary_treatment=False, binary_outcome=False, min_samples_per_env=25, independence_test_args={}, n_bootstraps=1000)[source]
Bases:
AbstractFalsificationAlgorithm- get_diagnostics()[source]
Returns quality of fit for nuisance models per environment from the most recent test() call.
- Returns:
Diagnostics for model fit, including source labels and mean squared errors for outcome and treatment models.
- Return type:
dict
- get_feature_representation()[source]
Returns function that outputs feature representation
Raises:
ValueError: If invalid feature_representation or feature_representation_params are provided
Returns:
: Callable function
Feature representation
- run_bootstrapped_independence_test(data_x, data_y, resampled_data_x, resampled_data_y)[source]
Runs bootstrapped independence test between data_x and data_y
Returns:
: float
p-value from test
- run_independence_test(data_x, data_y)[source]
Runs independence test between data_x and data_y
Returns:
: float
p-value from test
- test(data, covariate_vars, treatment_var, outcome_var, source_var)[source]
Perform falsification test for joint test of unconfoundedness and independence of causal mechanisms.
- Parameters:
data (pandas.DataFrame) – DataFrame containing all data from all environments.
covariate_vars (list of str) – List of covariate column names.
treatment_var (str) – Name of the treatment column.
outcome_var (str) – Name of the outcome column.
source_var (str) – Name of the source/environment column.
- Returns:
p-value from the independence test; low p-value implies unmeasured confounding may be present.
- Return type:
float