diff --git a/imblearn/under_sampling/_prototype_selection/_condensed_nearest_neighbour.py b/imblearn/under_sampling/_prototype_selection/_condensed_nearest_neighbour.py index 3b812e620..ac012a073 100644 --- a/imblearn/under_sampling/_prototype_selection/_condensed_nearest_neighbour.py +++ b/imblearn/under_sampling/_prototype_selection/_condensed_nearest_neighbour.py @@ -110,17 +110,20 @@ class CondensedNearestNeighbour(BaseCleaningSampler): Examples -------- >>> from collections import Counter # doctest: +SKIP - >>> from sklearn.datasets import fetch_mldata # doctest: +SKIP + >>> from sklearn.datasets import fetch_openml # doctest: +SKIP + >>> from sklearn.preprocessing import scale # doctest: +SKIP >>> from imblearn.under_sampling import \ CondensedNearestNeighbour # doctest: +SKIP - >>> pima = fetch_mldata('diabetes_scale') # doctest: +SKIP - >>> X, y = pima['data'], pima['target'] # doctest: +SKIP + >>> X, y = fetch_openml('diabetes', version=1, return_X_y=True) # doctest: +SKIP + >>> X = scale(X) # doctest: +SKIP >>> print('Original dataset shape %s' % Counter(y)) # doctest: +SKIP - Original dataset shape Counter({{1: 500, -1: 268}}) # doctest: +SKIP + Original dataset shape Counter({{'tested_negative': 500, \ + 'tested_positive': 268}}) # doctest: +SKIP >>> cnn = CondensedNearestNeighbour(random_state=42) # doctest: +SKIP >>> X_res, y_res = cnn.fit_resample(X, y) #doctest: +SKIP >>> print('Resampled dataset shape %s' % Counter(y_res)) # doctest: +SKIP - Resampled dataset shape Counter({{-1: 268, 1: 227}}) # doctest: +SKIP + Resampled dataset shape Counter({{'tested_positive': 268, \ + 'tested_negative': 181}}) # doctest: +SKIP """ _parameter_constraints: dict = {