Skip to content

Commit

Permalink
Add GC collections
Browse files Browse the repository at this point in the history
  • Loading branch information
kbattocchi committed Apr 5, 2022
1 parent 96d7292 commit 1ac12db
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions econml/tests/test_causal_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,9 @@ def test_random_state(self):
np.testing.assert_equal(glo.point.values, glo2.point.values)
np.testing.assert_equal(glo.stderr.values, glo2.stderr.values)

del ca, glo, ca2, glo
gc.collect()

def test_can_set_categories(self):
y = pd.Series(np.random.choice([0, 1], size=(500,)))
X = pd.DataFrame({'a': np.random.normal(size=500),
Expand Down Expand Up @@ -785,6 +788,9 @@ def test_invalid_inds(self):
self.assertEqual(ca.untrained_feature_indices_, [(4, 'cat_limit'),
(5, 'cat_limit')])

del ca
gc.collect()

# Add tests that guarantee that the reliance on DML feature order is not broken, such as
# Creare a transformer that zeros out all variables after the first n_x variables, so it zeros out W
# Pass an example where W is irrelevant and X is confounder
Expand Down

0 comments on commit 1ac12db

Please sign in to comment.