Skip to content

Commit 162e28d

Browse files
committed
Revert "Add: initial unit tests for causal surrogate"
This reverts commit e244470.
1 parent e244470 commit 162e28d

File tree

3 files changed

+0
-82
lines changed

3 files changed

+0
-82
lines changed

tests/surrogate_tests/test_causal_surrogate_assisted.py

Lines changed: 0 additions & 42 deletions
This file was deleted.

tests/surrogate_tests/test_surrogate_search_algorithms.py

Whitespace-only changes.

tests/testing_tests/test_estimators.py

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
CausalForestEstimator,
88
LogisticRegressionEstimator,
99
InstrumentalVariableEstimator,
10-
PolynomialRegressionEstimator
1110
)
1211
from causal_testing.specification.variable import Input
1312
from causal_testing.utils.validation import CausalValidator
@@ -410,43 +409,6 @@ def test_program_11_2_with_robustness_validation(self):
410409
self.assertEqual(round(cv.estimate_robustness(model)["treatments"], 4), 0.7353)
411410

412411

413-
class TestPolynomialRegressionEstimator(TestLinearRegressionEstimator):
414-
415-
@classmethod
416-
417-
def setUpClass(cls):
418-
419-
super().setUpClass()
420-
def test_program_11_3_polynomial(self):
421-
422-
"""Test whether the polynomial regression implementation produces the same results as program 11.3 (p. 162).
423-
https://www.hsph.harvard.edu/miguel-hernan/wp-content/uploads/sites/1268/2023/10/hernanrobins_WhatIf_30sep23.pdf
424-
"""
425-
426-
df = self.chapter_11_df.copy()
427-
428-
polynomial_estimator = PolynomialRegressionEstimator(
429-
"treatments", None, None, set(), "outcomes", 3, df)
430-
431-
model = polynomial_estimator._run_linear_regression()
432-
433-
ate, _ = polynomial_estimator.estimate_coefficient()
434-
435-
self.assertEqual(
436-
round(
437-
model.params["Intercept"]
438-
+ 90 * model.params["treatments"]
439-
+ 90 * 90 * model.params["np.power(treatments, 2)"],
440-
1,
441-
),
442-
197.1,
443-
)
444-
# Increasing treatments from 90 to 100 should be the same as 10 times the unit ATE
445-
self.assertEqual(round(model.params["treatments"], 3), round(ate, 3))
446-
447-
448-
449-
450412
class TestCausalForestEstimator(unittest.TestCase):
451413
"""Test the linear regression estimator against the programming exercises in Section 2 of Hernán and Robins [1].
452414
@@ -529,5 +491,3 @@ def test_X1_effect(self):
529491
test_results = lr_model.estimate_ate()
530492
ate = test_results[0]
531493
self.assertAlmostEqual(ate, 2.0)
532-
533-

0 commit comments

Comments
 (0)