MCPcopy Create free account
hub / github.com/modAL-python/modAL / test_multi_argmax

Method test_multi_argmax

tests/core_tests.py:204–216  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected