@@ 129-148 (lines=20) @@ | ||
126 | search_data["eval_times"] |
|
127 | ||
128 | ||
129 | def test_attributes_results_8(): |
|
130 | def objective_function(opt): |
|
131 | score = -opt["x1"] * opt["x1"] |
|
132 | return score |
|
133 | ||
134 | search_space = { |
|
135 | "x1": list(np.arange(0, 10, 1)), |
|
136 | } |
|
137 | ||
138 | hyper = Hyperactive() |
|
139 | hyper.add_search( |
|
140 | objective_function, |
|
141 | search_space, |
|
142 | n_iter=20, |
|
143 | ) |
|
144 | hyper.run() |
|
145 | ||
146 | search_data = hyper.search_data(objective_function) |
|
147 | with pytest.raises(Exception) as e_info: |
|
148 | search_data["iter_times"] |
|
149 | ||
150 | ||
151 | def test_attributes_results_9(): |
|
@@ 107-126 (lines=20) @@ | ||
104 | assert len(set(x1_results)) < len(x1_results) |
|
105 | ||
106 | ||
107 | def test_attributes_results_7(): |
|
108 | def objective_function(opt): |
|
109 | score = -opt["x1"] * opt["x1"] |
|
110 | return score |
|
111 | ||
112 | search_space = { |
|
113 | "x1": list(np.arange(0, 10, 1)), |
|
114 | } |
|
115 | ||
116 | hyper = Hyperactive() |
|
117 | hyper.add_search( |
|
118 | objective_function, |
|
119 | search_space, |
|
120 | n_iter=20, |
|
121 | ) |
|
122 | hyper.run() |
|
123 | ||
124 | search_data = hyper.search_data(objective_function) |
|
125 | with pytest.raises(Exception) as e_info: |
|
126 | search_data["eval_times"] |
|
127 | ||
128 | ||
129 | def test_attributes_results_8(): |