def test_diversity_metric_Q(create_X_y): X, y = create_X_y test = DESClustering(metric_diversity='Q') # Mocking this method to avoid preprocessing the cluster information # that is not required in this test. test._preprocess_clusters = MagicMock(return_value=1) test.fit(X, y) assert test.diversity_func_ == Q_statistic
def test_diversity_metric_DF(create_X_y): X, y = create_X_y test = DESClustering(metric_diversity='DF') # Mocking this method to avoid preprocessing the cluster # information that is not required in this test. test._preprocess_clusters = MagicMock(return_value=1) test.fit(X, y) assert test.diversity_func_ == negative_double_fault
def test_diversity_metric_ratio(): test = DESClustering(create_pool_classifiers() * 10, metric='ratio') # Mocking this method to avoid preprocessing the cluster information that is not required in this test. test._preprocess_clusters = MagicMock(return_value=1) test.fit(X_dsel_ex1, y_dsel_ex1) assert test.diversity_func_ == ratio_errors