From 2bde7386c3d90873ed2d598397089b32b8c9336c Mon Sep 17 00:00:00 2001 From: Nada Adel Date: Wed, 16 Feb 2022 10:22:02 +0200 Subject: [PATCH 1/2] edit typos in miscellaneous.rst --- doc/miscellaneous.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/miscellaneous.rst b/doc/miscellaneous.rst index 9da707a6a..05118cb3a 100644 --- a/doc/miscellaneous.rst +++ b/doc/miscellaneous.rst @@ -34,7 +34,7 @@ to retain the 10 first elements of the array ``X`` and ``y``:: >>> np.all(y_res == y[:10]) True -In addition, the parameter ``validate`` control input checking. For instance, +In addition, the parameter ``validate`` controls input checking. For instance, turning ``validate=False`` allows to pass any type of target ``y`` and do some sampling for regression targets:: @@ -51,7 +51,7 @@ sampling for regression targets:: 75.46571114, -67.49177372, 159.72700509, -169.80498923, 211.95889757, 211.95889757]) -We illustrate the use of such sampler to implement an outlier rejection +We illustrated the use of such sampler to implement an outlier rejection estimator which can be easily used within a :class:`~imblearn.pipeline.Pipeline`: :ref:`sphx_glr_auto_examples_applications_plot_outlier_rejections.py` @@ -69,7 +69,7 @@ will generate balanced mini-batches. TensorFlow generator ~~~~~~~~~~~~~~~~~~~~ -The :func:`~imblearn.tensorflow.balanced_batch_generator` allow to generate +The :func:`~imblearn.tensorflow.balanced_batch_generator` allows to generate balanced mini-batches using an imbalanced-learn sampler which returns indices. Let's first generate some data:: @@ -96,7 +96,7 @@ balanced:: ... random_state=42, ... ) -The ``generator`` and ``steps_per_epoch`` is used during the training of the +The ``generator`` and ``steps_per_epoch`` are used during the training of the Tensorflow model. We will illustrate how to use this generator. First, we can define a logistic regression model which will be optimized by a gradient descent:: From 666e5fe7c5247e2da3261ad7bc2d16b0c224d081 Mon Sep 17 00:00:00 2001 From: Guillaume Lemaitre Date: Wed, 16 Mar 2022 19:52:49 +0100 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Christos Aridas --- doc/miscellaneous.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/miscellaneous.rst b/doc/miscellaneous.rst index 05118cb3a..489b60898 100644 --- a/doc/miscellaneous.rst +++ b/doc/miscellaneous.rst @@ -73,6 +73,7 @@ The :func:`~imblearn.tensorflow.balanced_batch_generator` allows to generate balanced mini-batches using an imbalanced-learn sampler which returns indices. Let's first generate some data:: + >>> n_features, n_classes = 10, 2 >>> X, y = make_classification( ... n_samples=10_000, n_features=n_features, n_informative=2, @@ -96,7 +97,7 @@ balanced:: ... random_state=42, ... ) -The ``generator`` and ``steps_per_epoch`` are used during the training of the +The ``generator`` and ``steps_per_epoch`` are used during the training of a Tensorflow model. We will illustrate how to use this generator. First, we can define a logistic regression model which will be optimized by a gradient descent::