Skip to content

Commit b90a018

Browse files
update causal_test_engine.py to use new test_result format
1 parent 9edf381 commit b90a018

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

causal_testing/testing/causal_test_engine.py

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,7 @@ def _return_causal_test_results(self, estimate_type, estimator, causal_test_case
158158

159159
cates_df, confidence_intervals = estimator.estimate_cates()
160160
causal_test_result = CausalTestResult(
161-
treatment=estimator.treatment,
162-
outcome=estimator.outcome,
163-
treatment_value=estimator.treatment_value,
164-
control_value=estimator.control_value,
165-
adjustment_set=estimator.adjustment_set,
161+
estimator=estimator,
166162
test_value=TestValue("ate", cates_df),
167163
effect_modifier_configuration=causal_test_case.effect_modifier_configuration,
168164
confidence_intervals=confidence_intervals,
@@ -171,11 +167,7 @@ def _return_causal_test_results(self, estimate_type, estimator, causal_test_case
171167
logger.debug("calculating risk_ratio")
172168
risk_ratio, confidence_intervals = estimator.estimate_risk_ratio()
173169
causal_test_result = CausalTestResult(
174-
treatment=estimator.treatment,
175-
outcome=estimator.outcome,
176-
treatment_value=estimator.treatment_value,
177-
control_value=estimator.control_value,
178-
adjustment_set=estimator.adjustment_set,
170+
estimator=estimator,
179171
test_value=TestValue("risk_ratio", risk_ratio),
180172
effect_modifier_configuration=causal_test_case.effect_modifier_configuration,
181173
confidence_intervals=confidence_intervals,
@@ -184,11 +176,7 @@ def _return_causal_test_results(self, estimate_type, estimator, causal_test_case
184176
logger.debug("calculating ate")
185177
ate, confidence_intervals = estimator.estimate_ate()
186178
causal_test_result = CausalTestResult(
187-
treatment=estimator.treatment,
188-
outcome=estimator.outcome,
189-
treatment_value=estimator.treatment_value,
190-
control_value=estimator.control_value,
191-
adjustment_set=estimator.adjustment_set,
179+
estimator=estimator,
192180
test_value=TestValue("ate", ate),
193181
effect_modifier_configuration=causal_test_case.effect_modifier_configuration,
194182
confidence_intervals=confidence_intervals,
@@ -199,11 +187,7 @@ def _return_causal_test_results(self, estimate_type, estimator, causal_test_case
199187
logger.debug("calculating ate")
200188
ate, confidence_intervals = estimator.estimate_ate_calculated()
201189
causal_test_result = CausalTestResult(
202-
treatment=estimator.treatment,
203-
outcome=estimator.outcome,
204-
treatment_value=estimator.treatment_value,
205-
control_value=estimator.control_value,
206-
adjustment_set=estimator.adjustment_set,
190+
estimator=estimator,
207191
test_value=TestValue("ate", ate),
208192
effect_modifier_configuration=causal_test_case.effect_modifier_configuration,
209193
confidence_intervals=confidence_intervals,

0 commit comments

Comments
 (0)