Exemple #1
0
def test_instance_hardness_region_all_same():
    X = X_dsel_ex1
    y = y_dsel_ex1
    ds_test = DS(create_pool_classifiers())
    ds_test.fit(X, y)
    neighbors = [0, 1, 2, 6, 7, 8, 13]
    IH = ds_test._hardness_region_competence(neighbors)
    assert IH == 0.0
Exemple #2
0
def test_instance_hardness_region(index, expected):
    X = X_dsel_ex1
    y = y_dsel_ex1
    ds_test = DS(create_pool_classifiers())
    ds_test.fit(X, y)
    neighbors = neighbors_ex1[index, :]
    IH = ds_test._hardness_region_competence(neighbors)
    assert np.isclose(IH, expected, atol=0.01)