Skip to content

Commit

Permalink
improve test 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonBlanke committed Sep 29, 2021
1 parent 816e70e commit 997789b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_hyper_gradient_trafo.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,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=10)
time.sleep(0.1)

return scores.mean()

Expand Down Expand Up @@ -119,7 +120,7 @@ def test_trafo_1(random_state, search_space, memory_warm_start):
hyper.add_search(
objective_function_1,
search_space,
n_iter=15,
n_iter=10,
random_state=random_state,
initialize={"random": 1},
)
Expand All @@ -131,15 +132,15 @@ def test_trafo_1(random_state, search_space, memory_warm_start):
hyper.add_search(
objective_function_1,
search_space,
n_iter=15,
n_iter=10,
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.3
assert d_time_1 < d_time_0 * 0.5


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

0 comments on commit 997789b

Please sign in to comment.