(self)
| 202 | # functions from modALu.tils.selection |
| 203 | |
| 204 | def test_multi_argmax(self): |
| 205 | for n_pool in range(2, 100): |
| 206 | for n_instances in range(1, n_pool+1): |
| 207 | utility = np.zeros(n_pool) |
| 208 | max_idx = np.random.choice( |
| 209 | range(n_pool), size=n_instances, replace=False) |
| 210 | utility[max_idx] = 1e-10 + np.random.rand(n_instances, ) |
| 211 | np.testing.assert_equal( |
| 212 | np.sort(modAL.utils.selection.multi_argmax( |
| 213 | utility, n_instances)), |
| 214 | (np.sort(max_idx), np.sort(utility) |
| 215 | [len(utility)-n_instances:]) |
| 216 | ) |
| 217 | |
| 218 | def test_shuffled_argmax(self): |
| 219 | for n_pool in range(1, 100): |
nothing calls this directly
no outgoing calls
no test coverage detected