(self)
| 229 | ) |
| 230 | |
| 231 | def test_weighted_random(self): |
| 232 | for n_pool in range(2, 100): |
| 233 | for n_instances in range(1, n_pool): |
| 234 | utility = np.ones(n_pool) |
| 235 | query_idx = modAL.utils.selection.weighted_random( |
| 236 | utility, n_instances) |
| 237 | # testing for correct number of returned indices |
| 238 | np.testing.assert_equal(len(query_idx), n_instances) |
| 239 | # testing for uniqueness of each query index |
| 240 | np.testing.assert_equal( |
| 241 | len(query_idx), len(np.unique(query_idx))) |
| 242 | |
| 243 | |
| 244 | class TestAcquisitionFunctions(unittest.TestCase): |
nothing calls this directly
no outgoing calls
no test coverage detected