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

Method test_shuffled_argmax

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

Source from the content-addressed store, hash-verified

216 )
217
218 def test_shuffled_argmax(self):
219 for n_pool in range(1, 100):
220 for n_instances in range(1, n_pool+1):
221 values = np.random.permutation(n_pool)
222 true_query_idx = np.argsort(values)[len(values)-n_instances:]
223 true_values = np.sort(values, axis=None)[
224 len(values)-n_instances:]
225
226 np.testing.assert_equal(
227 (true_query_idx, true_values),
228 modAL.utils.selection.shuffled_argmax(values, n_instances)
229 )
230
231 def test_weighted_random(self):
232 for n_pool in range(2, 100):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected