def test_sample_selection_working(): meta_test = METADES( create_pool_all_agree(0, 10) + create_pool_all_agree(1, 5)) meta_test.processed_dsel = np.ones((5, 15)) meta_test.processed_dsel[(1, 3, 4), 5:] = 0 expected = np.asarray([1, 1 / 3, 1, 1 / 3, 1 / 3]) value = meta_test._sample_selection_agreement() assert np.array_equal(value, expected)
def test_sample_selection_working(): meta_test = METADES() meta_test.n_classifiers_ = 15 meta_test.DSEL_processed_ = np.ones((5, 15)) meta_test.DSEL_processed_[(1, 3, 4), 5:] = 0 expected = np.asarray([1, 1 / 3, 1, 1 / 3, 1 / 3]) value = meta_test._sample_selection_agreement() assert np.array_equal(value, expected)
def test_sample_selection_working(): pool_classifiers = create_pool_all_agree(0, 10) + create_pool_all_agree( 1, 5) meta_test = METADES(pool_classifiers=pool_classifiers) meta_test.n_classifiers_ = len(pool_classifiers) meta_test.DSEL_processed_ = np.ones((5, 15)) meta_test.DSEL_processed_[(1, 3, 4), 5:] = 0 expected = np.asarray([1, 1 / 3, 1, 1 / 3, 1 / 3]) value = meta_test._sample_selection_agreement() assert np.array_equal(value, expected)
def test_sample_selection(): meta_test = METADES( create_pool_all_agree(0, 10) + create_pool_all_agree(1, 5)) meta_test.processed_dsel = dsel_processed_ex1 value = meta_test._sample_selection_agreement(0) assert value == 0.2