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

Method test_vote

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

Source from the content-addressed store, hash-verified

1429 )
1430
1431 def test_vote(self):
1432 for n_members in range(1, 10):
1433 for n_instances in range(1, 100):
1434 vote_output = np.random.randint(
1435 0, 2, size=(n_instances, n_members))
1436 # assembling the Committee
1437 learner_list = [mock.MockActiveLearner(
1438 predict_return=vote_output[:, member_idx],
1439 predictor=mock.MockEstimator(classes_=[0])
1440 )
1441 for member_idx in range(n_members)]
1442 committee = modAL.models.learners.Committee(
1443 learner_list=learner_list)
1444 np.testing.assert_array_almost_equal(
1445 committee.vote(np.random.rand(n_instances).reshape(-1, 1)),
1446 vote_output
1447 )
1448
1449 def test_vote_proba(self):
1450 for n_samples in range(1, 100):

Callers

nothing calls this directly

Calls 1

voteMethod · 0.95

Tested by

no test coverage detected