Skip to content

Commit

Permalink
Update test cases
Browse files Browse the repository at this point in the history
Signed-off-by: amarv <[email protected]>
  • Loading branch information
amarvenu committed Jan 10, 2024
1 parent 41c4068 commit 078630a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions econml/tests/test_drtester.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,6 @@ def test_exceptions(self):
self.assertTrue(str(exc.exception) ==
"CATE predictions not yet calculated - must provide both Xval, Xtrain")

with self.assertRaises(Exception) as exc:
my_dr_tester.evaluate_uplift(metric='blah')
self.assertTrue(
str(exc.exception) == "Uplift metric must be one of ['qini', 'toc']"
)

for func in [
my_dr_tester.evaluate_cal,
my_dr_tester.evaluate_uplift,
Expand All @@ -264,6 +258,12 @@ def test_exceptions(self):
cal_res = my_dr_tester.evaluate_cal(Xval, Xtrain)
self.assertGreater(cal_res.cal_r_squared[0], 0) # good R2

with self.assertRaises(Exception) as exc:
my_dr_tester.evaluate_uplift(metric='blah')
self.assertTrue(
str(exc.exception) == "Unsupported metric - must be one of ['toc', 'qini']"
)

my_dr_tester = DRtester(
model_regression=reg_y,
model_propensity=reg_t,
Expand Down

0 comments on commit 078630a

Please sign in to comment.