3
3
4
4
from causal_testing .specification .variable import Variable
5
5
from causal_testing .testing .causal_test_outcome import CausalTestOutcome
6
-
6
+ from causal_testing . testing . base_causal_test import BaseCausalTest
7
7
logger = logging .getLogger (__name__ )
8
8
9
9
10
- class CausalTestCase :
11
- """
10
+ class CausalTestCase ( BaseCausalTest ) :
11
+ """)
12
12
A causal test case is a triple (X, Delta, Y), where X is an input configuration, Delta is an intervention, and
13
13
Y is the expected causal effect on a particular output. The goal of a causal test case is to test whether the
14
14
intervention Delta made to the input configuration X causes the model-under-test to produce the expected change
@@ -17,13 +17,13 @@ class CausalTestCase:
17
17
18
18
def __init__ (
19
19
self ,
20
- control_input_configuration : dict [ Variable : Any ] ,
20
+ base_causal_test : BaseCausalTest ,
21
21
expected_causal_effect : CausalTestOutcome ,
22
- outcome_variables : dict [Variable ],
23
- treatment_input_configuration : dict [Variable :Any ] = None ,
22
+ control_value : Any ,
23
+ outcome_value : Any ,
24
+ treatment_value : Any = None ,
24
25
estimate_type : str = "ate" ,
25
26
effect_modifier_configuration : dict [Variable :Any ] = None ,
26
- effect : str = "total" ,
27
27
):
28
28
"""
29
29
When a CausalTestCase is initialised, it takes the intervention and applies it to the input configuration to
@@ -36,12 +36,12 @@ def __init__(
36
36
:param treatment_input_configuration: The input configuration representing the treatment values of the treatment
37
37
variables. That is, the input configuration *after* applying the intervention.
38
38
"""
39
- self .control_input_configuration = control_input_configuration
39
+ self .control_input_configuration = { base_causal_test . treatment_variable : control_value }
40
40
self .expected_causal_effect = expected_causal_effect
41
- self .outcome_variables = outcome_variables
42
- self .treatment_input_configuration = treatment_input_configuration
41
+ self .outcome_variable = base_causal_test . outcome_variable
42
+ self .treatment_input_configuration = { base_causal_test . treatment_variable : treatment_value }
43
43
self .estimate_type = estimate_type
44
- self .effect = effect
44
+ self .effect = base_causal_test . effect
45
45
if effect_modifier_configuration :
46
46
self .effect_modifier_configuration = effect_modifier_configuration
47
47
else :
0 commit comments