@@ 139-166 (lines=28) @@ | ||
136 | assert pyplot_fig is not None |
|
137 | ||
138 | ||
139 | def test_streamlit_backend_2(): |
|
140 | search_id1 = "test_model1" |
|
141 | search_id2 = "test_model2" |
|
142 | search_id3 = "test_model3" |
|
143 | ||
144 | search_ids = [search_id1, search_id2, search_id3] |
|
145 | ||
146 | board = StreamlitBackend(search_ids) |
|
147 | ||
148 | def objective_function(opt): |
|
149 | score = -opt["x1"] * opt["x1"] |
|
150 | return score |
|
151 | ||
152 | search_space = { |
|
153 | "x1": np.arange(-100, 101, 1), |
|
154 | } |
|
155 | ||
156 | hyper = Hyperactive() |
|
157 | hyper.add_search(objective_function, search_space, n_iter=200) |
|
158 | hyper.run() |
|
159 | search_data = hyper.results(objective_function) |
|
160 | search_data["nth_iter"] = 0 |
|
161 | search_data["score_best"] = 0 |
|
162 | search_data["nth_process"] = 0 |
|
163 | ||
164 | plotly_fig = board.plotly(search_data, search_id1) |
|
165 | ||
166 | assert plotly_fig is not None |
|
167 | ||
168 | ||
169 | def test_streamlit_backend_3(): |
|
@@ 109-136 (lines=28) @@ | ||
106 | assert progress_data is None |
|
107 | ||
108 | ||
109 | def test_streamlit_backend_1(): |
|
110 | search_id1 = "test_model1" |
|
111 | search_id2 = "test_model2" |
|
112 | search_id3 = "test_model3" |
|
113 | ||
114 | search_ids = [search_id1, search_id2, search_id3] |
|
115 | ||
116 | board = StreamlitBackend(search_ids) |
|
117 | ||
118 | def objective_function(opt): |
|
119 | score = -opt["x1"] * opt["x1"] |
|
120 | return score |
|
121 | ||
122 | search_space = { |
|
123 | "x1": np.arange(-100, 101, 1), |
|
124 | } |
|
125 | ||
126 | hyper = Hyperactive() |
|
127 | hyper.add_search(objective_function, search_space, n_iter=200) |
|
128 | hyper.run() |
|
129 | search_data = hyper.results(objective_function) |
|
130 | search_data["nth_iter"] = 0 |
|
131 | search_data["score_best"] = 0 |
|
132 | search_data["nth_process"] = 0 |
|
133 | ||
134 | pyplot_fig = board.pyplot(search_data) |
|
135 | ||
136 | assert pyplot_fig is not None |
|
137 | ||
138 | ||
139 | def test_streamlit_backend_2(): |