Skip to content

Commit 1d547af

Browse files
committed
iter
1 parent 85d1f66 commit 1d547af

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

doc/miscellaneous.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ to retain the 10 first elements of the array ``X`` and ``y``::
3131
>>> X_res, y_res = sampler.fit_sample(X, y)
3232
>>> np.all(X_res == X[:10])
3333
True
34-
>>> np.all(y_res == y_res[:10])
34+
>>> np.all(y_res == y[:10])
3535
True
3636

3737
We illustrate the use of such sampler to implement an outlier rejection

imblearn/misc.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class FunctionSampler(SamplerMixin):
4343
4444
Examples
4545
--------
46+
>>> import numpy as np
4647
>>> from sklearn.datasets import make_classification
4748
>>> from imblearn.misc import FunctionSampler
4849
>>> X, y = make_classification(n_classes=2, class_sep=2,
@@ -55,9 +56,9 @@ class FunctionSampler(SamplerMixin):
5556
... return X[:10], y[:10]
5657
>>> sampler = FunctionSampler(func=func)
5758
>>> X_res, y_res = sampler.fit_sample(X, y)
58-
>>> (X_res == X[:10]).all()
59+
>>> np.all(X_res == X[:10])
5960
True
60-
>>> (y_res == y_res[:10]).all()
61+
>>> np.all(y_res == y[:10])
6162
True
6263
6364
We can also create a specific function which take some arguments.

0 commit comments

Comments
 (0)