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)
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)
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()
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()