Skip to content

Commit

Permalink
improve test of memory_warm_start
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonBlanke committed Sep 29, 2021
1 parent d3b0860 commit 816e70e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_hyper_gradient_trafo.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_trafo_0(search_space):

def objective_function_1(opt):
dtc = DecisionTreeClassifier(min_samples_split=opt["min_samples_split"])
scores = cross_val_score(dtc, X, y, cv=5)
scores = cross_val_score(dtc, X, y, cv=10)

return scores.mean()

Expand Down Expand Up @@ -119,7 +119,7 @@ def test_trafo_1(random_state, search_space, memory_warm_start):
hyper.add_search(
objective_function_1,
search_space,
n_iter=25,
n_iter=15,
random_state=random_state,
initialize={"random": 1},
)
Expand All @@ -131,15 +131,15 @@ def test_trafo_1(random_state, search_space, memory_warm_start):
hyper.add_search(
objective_function_1,
search_space,
n_iter=25,
n_iter=15,
random_state=random_state,
initialize={"random": 1},
memory_warm_start=memory_warm_start,
)
hyper.run()
d_time_1 = time.time() - c_time_1

assert d_time_1 < d_time_0 * 0.8
assert d_time_1 < d_time_0 * 0.3


# ----------------- # Test if wrong memory warm starts do not work as intended
Expand Down

0 comments on commit 816e70e

Please sign in to comment.