Beispiel #1
0
def test_select_random_classifier():
    competences = np.random.rand(100)
    expected = np.where(competences > 0.25)[0]
    probabilistic_test = Probabilistic(create_pool_all_agree(1, 100))
    probabilistic_test.n_classes = 4
    indices = probabilistic_test.select(competences)
    assert np.array_equal(indices, expected)
Beispiel #2
0
def test_select_all_ones():
    competences = np.ones(100)
    probabilistic_test = Probabilistic(create_pool_all_agree(1, 100))
    probabilistic_test.n_classes = 2
    indices = probabilistic_test.select(competences)
    assert indices == list(range(100))
def test_select_all_zeros():
    competences = np.zeros(100)
    probabilistic_test = Probabilistic(create_pool_all_agree(1, 100))
    probabilistic_test.n_classes = 2
    selected_matrix = probabilistic_test.select(competences)
    assert selected_matrix.all()