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

Method test_predict

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

Source from the content-addressed store, hash-verified

1392 )
1393
1394 def test_predict(self):
1395 for n_learners in range(1, 10):
1396 for n_instances in range(1, 10):
1397 prediction = np.random.randint(
1398 10, size=(n_instances, n_learners))
1399 committee = modAL.models.learners.Committee(
1400 learner_list=[mock.MockActiveLearner(
1401 mock.MockEstimator(classes_=np.asarray([0])),
1402 predict_return=prediction[:, learner_idx]
1403 )
1404 for learner_idx in range(n_learners)]
1405 )
1406 np.testing.assert_equal(
1407 committee.vote(np.random.rand(n_instances, 5)),
1408 prediction
1409 )
1410
1411 def test_predict_proba(self):
1412 for n_samples in range(1, 100):

Callers

nothing calls this directly

Calls 1

voteMethod · 0.95

Tested by

no test coverage detected