Exemple #1
0
def test_get_dsel_scores():
    ds_test = DS(create_pool_classifiers())
    ds_test.fit(X_dsel_ex1, y_dsel_ex1)
    ds_test.dsel_scores = dsel_scores_ex1
    assert np.array_equal(ds_test._get_scores_dsel(0, 0), np.array([1.0, 0.0]))
    assert np.array_equal(ds_test._get_scores_dsel(1, 0), np.array([0.5, 0.5]))
    assert np.array_equal(ds_test._get_scores_dsel(2, 0), np.array([0.8, 0.2]))
Exemple #2
0
def test_get_dsel_scores_not_processed():
    ds_test = DS(create_pool_classifiers())
    ds_test.fit(X_dsel_ex1, y_dsel_ex1)
    with pytest.raises(NotFittedError):
        ds_test._get_scores_dsel(0)
Exemple #3
0
def test_get_dsel_scores_all_samples():
    ds_test = DS(create_pool_classifiers())
    ds_test.fit(X_dsel_ex1, y_dsel_ex1)
    ds_test.dsel_scores = dsel_scores_ex1
    expected = np.ones((15, 2)) * 0.5
    assert np.array_equal(ds_test._get_scores_dsel(1), expected)