causal_testing.testing.causal_test_case
This module contains the CausalTestCase class, a class that holds the information required for a causal test
Module Contents
Classes
A CausalTestCase extends the information held in a BaseTestCase. As well as storing the treatment and outcome |
Attributes
- causal_testing.testing.causal_test_case.logger
- class causal_testing.testing.causal_test_case.CausalTestCase(base_test_case: causal_testing.testing.base_test_case.BaseTestCase, expected_causal_effect: causal_testing.testing.causal_effect.CausalEffect, estimate_type: str = 'ate', estimate_params: dict = None, estimator: type(Estimator) = None)
A CausalTestCase extends the information held in a BaseTestCase. As well as storing the treatment and outcome variables, a CausalTestCase stores the values of these variables. Also the outcome variable and value are specified. The goal of a CausalTestCase is to test whether the intervention made to the control via the treatment causes the model-under-test to produce the expected change. :param base_test_case: A BaseTestCase object consisting of a treatment variable, outcome variable and effect :param expected_causal_effect: The expected causal effect (Positive, Negative, No Effect). :param estimate_type: A string which denotes the type of estimate to return. :param estimator: An Estimator class object
- execute_test(estimator: type(Estimator) = None) causal_testing.testing.causal_test_result.CausalTestResult
Execute a causal test case and return the causal test result. :param estimator: An alternative estimator. Defaults to self.estimator. This parameter is useful when you want to execute a test with different data or a different equational form, but don’t want to redefine the whole test case.
- Return causal_test_result:
A CausalTestResult for the executed causal test case.
- __str__()
Return str(self).