Skip to content

Commit 59cd732

Browse files
committed
iter
1 parent 3f7a26a commit 59cd732

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

doc/miscellaneous.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ a single function. Additional parameters can be added using the attribute
1717
``kw_args`` which accepts a dictionary. The following example illustrates how
1818
to retain the 10 first elements of the array ``X`` and ``y``::
1919

20+
>>> import numpy as np
2021
>>> from imblearn.misc import FunctionSampler
2122
>>> from sklearn.datasets import make_classification
2223
>>> X, y = make_classification(n_samples=5000, n_features=2, n_informative=2,
@@ -28,9 +29,9 @@ to retain the 10 first elements of the array ``X`` and ``y``::
2829
... return X[:10], y[10:]
2930
>>> sampler = FunctionSampler(func=func)
3031
>>> X_res, y_res = sampler.fit_sample(X, y)
31-
>>> (X_res == X[:10]).all()
32+
>>> np.all(X_res == X[:10])
3233
True
33-
>>> (y_res == y_res[:10]).all()
34+
>>> np.all(y_res == y_res[:10])
3435
True
3536

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

0 commit comments

Comments
 (0)