@@ -118,7 +118,7 @@ def test_execute_test_observational_causal_forest_estimator(self):
118
118
self .df ,
119
119
)
120
120
causal_test_result = self .causal_test_case .execute_test (estimation_model , self .data_collector )
121
- self . assertAlmostEqual (causal_test_result .test_value .value [ 0 ], 4 , delta = 1 )
121
+ pd . testing . assert_series_equal (causal_test_result .test_value .value , pd . Series ( 4.0 ), atol = 1 )
122
122
123
123
def test_invalid_causal_effect (self ):
124
124
"""Check that executing the causal test case returns the correct results for dummy data using a linear
@@ -140,7 +140,7 @@ def test_execute_test_observational_linear_regression_estimator(self):
140
140
self .df ,
141
141
)
142
142
causal_test_result = self .causal_test_case .execute_test (estimation_model , self .data_collector )
143
- self . assertAlmostEqual (causal_test_result .test_value .value [ 0 ], 4 , delta = 1e-10 )
143
+ pd . testing . assert_series_equal (causal_test_result .test_value .value , pd . Series ( 4.0 ), atol = 1e-10 )
144
144
145
145
def test_execute_test_observational_linear_regression_estimator_direct_effect (self ):
146
146
"""Check that executing the causal test case returns the correct results for dummy data using a linear
@@ -167,7 +167,7 @@ def test_execute_test_observational_linear_regression_estimator_direct_effect(se
167
167
self .df ,
168
168
)
169
169
causal_test_result = causal_test_case .execute_test (estimation_model , self .data_collector )
170
- self . assertAlmostEqual (causal_test_result .test_value .value [ 0 ], 4 , delta = 1e-10 )
170
+ pd . testing . assert_series_equal (causal_test_result .test_value .value , pd . Series ( 4.0 ), atol = 1e-10 )
171
171
172
172
def test_execute_test_observational_linear_regression_estimator_coefficient (self ):
173
173
"""Check that executing the causal test case returns the correct results for dummy data using a linear
@@ -182,7 +182,7 @@ def test_execute_test_observational_linear_regression_estimator_coefficient(self
182
182
)
183
183
self .causal_test_case .estimate_type = "coefficient"
184
184
causal_test_result = self .causal_test_case .execute_test (estimation_model , self .data_collector )
185
- self . assertEqual ( int ( causal_test_result .test_value .value ), 0 )
185
+ pd . testing . assert_series_equal ( causal_test_result .test_value .value , pd . Series ({ 'D' : 0.0 }), atol = 1e-1 )
186
186
187
187
def test_execute_test_observational_linear_regression_estimator_risk_ratio (self ):
188
188
"""Check that executing the causal test case returns the correct results for dummy data using a linear
@@ -197,7 +197,7 @@ def test_execute_test_observational_linear_regression_estimator_risk_ratio(self)
197
197
)
198
198
self .causal_test_case .estimate_type = "risk_ratio"
199
199
causal_test_result = self .causal_test_case .execute_test (estimation_model , self .data_collector )
200
- self . assertEqual ( int ( causal_test_result .test_value .value ), 0 )
200
+ pd . testing . assert_series_equal ( causal_test_result .test_value .value , pd . Series ( 0.0 ), atol = 1 )
201
201
202
202
def test_invalid_estimate_type (self ):
203
203
"""Check that executing the causal test case returns the correct results for dummy data using a linear
@@ -227,7 +227,7 @@ def test_execute_test_observational_linear_regression_estimator_squared_term(sel
227
227
formula = f"C ~ A + { '+' .join (self .minimal_adjustment_set )} + (D ** 2)" ,
228
228
)
229
229
causal_test_result = self .causal_test_case .execute_test (estimation_model , self .data_collector )
230
- self . assertAlmostEqual ( round ( causal_test_result .test_value .value [ 0 ], 1 ), 4 , delta = 1 )
230
+ pd . testing . assert_series_equal ( causal_test_result .test_value .value , pd . Series ( 4.0 ), atol = 1 )
231
231
232
232
def test_execute_observational_causal_forest_estimator_cates (self ):
233
233
"""Check that executing the causal test case returns the correct conditional average treatment effects for
0 commit comments