@@ 68-88 (lines=21) @@ | ||
65 | assert int(len(results) / n_jobs) != len(no_dup) |
|
66 | ||
67 | ||
68 | def test_random_state_n_jobs_2(): |
|
69 | n_jobs = 4 |
|
70 | ||
71 | hyper = Hyperactive() |
|
72 | hyper.add_search( |
|
73 | objective_function, |
|
74 | search_space, |
|
75 | n_iter=5, |
|
76 | initialize={"random": 1}, |
|
77 | random_state=1, |
|
78 | n_jobs=n_jobs, |
|
79 | ) |
|
80 | hyper.run() |
|
81 | ||
82 | results = hyper.search_data(objective_function) |
|
83 | ||
84 | no_dup = results.drop_duplicates(subset=list(search_space.keys())) |
|
85 | print("no_dup", no_dup) |
|
86 | print("results", results) |
|
87 | ||
88 | assert int(len(results) / n_jobs) != len(no_dup) |
|
89 | ||
90 | ||
91 | def test_random_state_0(): |
|
@@ 45-65 (lines=21) @@ | ||
42 | assert int(len(results) / n_jobs) != len(no_dup) |
|
43 | ||
44 | ||
45 | def test_random_state_n_jobs_1(): |
|
46 | n_jobs = 3 |
|
47 | ||
48 | hyper = Hyperactive() |
|
49 | hyper.add_search( |
|
50 | objective_function, |
|
51 | search_space, |
|
52 | n_iter=5, |
|
53 | initialize={"random": 1}, |
|
54 | random_state=1, |
|
55 | n_jobs=n_jobs, |
|
56 | ) |
|
57 | hyper.run() |
|
58 | ||
59 | results = hyper.search_data(objective_function) |
|
60 | ||
61 | no_dup = results.drop_duplicates(subset=list(search_space.keys())) |
|
62 | print("no_dup", no_dup) |
|
63 | print("results", results) |
|
64 | ||
65 | assert int(len(results) / n_jobs) != len(no_dup) |
|
66 | ||
67 | ||
68 | def test_random_state_n_jobs_2(): |