Ejemplo n.º 1
0
def test_select_single_sample():
    des_mi = DESMI(pct_accuracy=0.7)
    des_mi.N_ = 2
    competences = np.array([0.7, 0.2, 1.0])
    selected_clf = des_mi.select(competences)
    expected = np.array([0, 2])
    assert np.array_equal(np.unique(selected_clf), np.unique(expected))
Ejemplo n.º 2
0
def test_select_batch_samples():
    n_samples = 10
    des_mi = DESMI(pct_accuracy=0.7)
    des_mi.N_ = 2
    competences = np.tile(np.array([0.7, 0.2, 1.0]), (n_samples, 1))
    selected_clf = des_mi.select(competences)
    expected = np.tile(np.array([0, 2]), (n_samples, 1))
    assert np.array_equal(np.unique(selected_clf), np.unique(expected))