|
7 | 7 | CausalForestEstimator,
|
8 | 8 | LogisticRegressionEstimator,
|
9 | 9 | InstrumentalVariableEstimator,
|
10 |
| - PolynomialRegressionEstimator |
11 | 10 | )
|
12 | 11 | from causal_testing.specification.variable import Input
|
13 | 12 | from causal_testing.utils.validation import CausalValidator
|
@@ -410,43 +409,6 @@ def test_program_11_2_with_robustness_validation(self):
|
410 | 409 | self.assertEqual(round(cv.estimate_robustness(model)["treatments"], 4), 0.7353)
|
411 | 410 |
|
412 | 411 |
|
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 |
| - |
450 | 412 | class TestCausalForestEstimator(unittest.TestCase):
|
451 | 413 | """Test the linear regression estimator against the programming exercises in Section 2 of Hernán and Robins [1].
|
452 | 414 |
|
@@ -529,5 +491,3 @@ def test_X1_effect(self):
|
529 | 491 | test_results = lr_model.estimate_ate()
|
530 | 492 | ate = test_results[0]
|
531 | 493 | self.assertAlmostEqual(ate, 2.0)
|
532 |
| - |
533 |
| - |
0 commit comments