Example #1
0
def test_select_random_classifier():
    competences = np.random.rand(1, 100)
    expected = (competences > 0.25)
    probabilistic_test = BaseProbabilistic()
    probabilistic_test.n_classes_ = 4
    indices = probabilistic_test.select(competences)
    assert np.array_equal(indices, expected)
Example #2
0
def test_select_threshold():
    competences = np.random.rand(1, 100)
    expected = (competences > 0.5)

    probabilistic_test = BaseProbabilistic()
    probabilistic_test.selection_threshold = 0.5
    indices = probabilistic_test.select(competences)
    assert np.array_equal(indices, expected)
Example #3
0
def test_select_all_zeros():
    competences = np.zeros(100)
    probabilistic_test = BaseProbabilistic()
    probabilistic_test.n_classes_ = 2
    selected_matrix = probabilistic_test.select(competences)
    assert selected_matrix.all()
Example #4
0
def test_select_all_ones():
    competences = np.ones(100)
    probabilistic_test = BaseProbabilistic(create_pool_all_agree(1, 100))
    probabilistic_test.n_classes_ = 2
    selected_matrix = probabilistic_test.select(competences)
    assert selected_matrix.all()