Skip to content

Commit 9304aa5

Browse files
committed
DOC fix docstring
1 parent a4af881 commit 9304aa5

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

doc/ensemble.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ under-sampling the original set::
2626
>>> X_resampled, y_resampled = ee.fit_sample(X, y)
2727
>>> print(X_resampled.shape)
2828
(10, 192, 2)
29-
>>> print(Counter(y_resampled[0]))
29+
>>> print(Counter(y_resampled[0])) # doctest: +SKIP
3030
Counter({0: 64, 1: 64, 2: 64})
3131

3232
:class:`EasyEnsemble` has two important parameters: (i) ``n_subsets`` will be
@@ -48,7 +48,7 @@ parameter ``n_max_subset`` and an additional bootstraping can be activated with
4848
>>> X_resampled, y_resampled = bc.fit_sample(X, y)
4949
>>> print(X_resampled.shape)
5050
(4, 192, 2)
51-
>>> print(Counter(y_resampled[0]))
51+
>>> print(Counter(y_resampled[0])) # docstest: +SKIP
5252
Counter({2: 64, 1: 64, 0: 64})
5353

5454
See

doc/over_sampling.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ randomly sampling with replacement the current available samples. The
2929
>>> ros = RandomOverSampler(random_state=0)
3030
>>> X_resampled, y_resampled = ros.fit_sample(X, y)
3131
>>> from collections import Counter
32-
>>> print(Counter(y_resampled))
32+
>>> print(Counter(y_resampled)) # doctest: +SKIP
3333
Counter({2: 4674, 1: 4674, 0: 4674})
3434

3535
The augmented data set should be used instead of the original data set to train
@@ -67,7 +67,7 @@ can be used in the same manner::
6767

6868
>>> from imblearn.over_sampling import SMOTE, ADASYN
6969
>>> X_resampled, y_resampled = SMOTE().fit_sample(X, y)
70-
>>> print(Counter(y_resampled))
70+
>>> print(Counter(y_resampled)) # doctest: +SKIP
7171
Counter({2: 4674, 1: 4674, 0: 4674})
7272
>>> clf_smote = LinearSVC().fit(X_resampled, y_resampled)
7373
>>> X_resampled, y_resampled = ADASYN().fit_sample(X, y)
@@ -132,7 +132,7 @@ available: (i) ``'borderline1'``, (ii) ``'borderline2'``, and (iii) ``'svm'``::
132132

133133
>>> from imblearn.over_sampling import SMOTE, ADASYN
134134
>>> X_resampled, y_resampled = SMOTE(kind='borderline1').fit_sample(X, y)
135-
>>> print(Counter(y_resampled))
135+
>>> print(Counter(y_resampled)) # doctest: +SKIP
136136
Counter({2: 4674, 1: 4674, 0: 4674})
137137

138138
See :ref:`sphx_glr_auto_examples_over-sampling_plot_comparison_over_sampling.py`

doc/under_sampling.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ randomly selecting a subset of data for the targeted classes::
9090
by considering independently each targeted class::
9191

9292
>>> import numpy as np
93-
>>> print(np.unique(X_resampled, axis=0).shape)
93+
>>> print(np.vstack({tuple(row) for row in X_resampled}).shape)
9494
(192, 2)
9595
>>> rus = RandomUnderSampler(random_state=0, replacement=True)
9696
>>> X_resampled, y_resampled = rus.fit_sample(X, y)
97-
>>> print(np.unique(X_resampled, axis=0).shape)
97+
>>> print(np.vstack({tuple(row) for row in X_resampled}).shape)
9898
(181, 2)
9999

100100
See :ref:`sphx_glr_auto_examples_plot_ratio_usage.py`,

0 commit comments

Comments
 (0)