From 759e265b79014e3d6047a3956104b63d66cb9002 Mon Sep 17 00:00:00 2001 From: greyisbetter Date: Mon, 7 Aug 2023 16:19:58 +0530 Subject: [PATCH 1/9] link to early stopping example --- doc/modules/ensemble.rst | 5 +++-- examples/ensemble/plot_gradient_boosting_early_stopping.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/modules/ensemble.rst b/doc/modules/ensemble.rst index 36eed98da0f6b..b83332a30f737 100644 --- a/doc/modules/ensemble.rst +++ b/doc/modules/ensemble.rst @@ -736,8 +736,9 @@ of ``learning_rate`` require larger numbers of weak learners to maintain a constant training error. Empirical evidence suggests that small values of ``learning_rate`` favor better test error. [HTF]_ recommend to set the learning rate to a small constant -(e.g. ``learning_rate <= 0.1``) and choose ``n_estimators`` by early -stopping. For a more detailed discussion of the interaction between +(e.g. ``learning_rate <= 0.1``) and choose ``n_estimators`` by +:ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py` +. For a more detailed discussion of the interaction between ``learning_rate`` and ``n_estimators`` see [R2007]_. Subsampling diff --git a/examples/ensemble/plot_gradient_boosting_early_stopping.py b/examples/ensemble/plot_gradient_boosting_early_stopping.py index f271f80a07c55..e8514fe2aff87 100644 --- a/examples/ensemble/plot_gradient_boosting_early_stopping.py +++ b/examples/ensemble/plot_gradient_boosting_early_stopping.py @@ -1,6 +1,6 @@ """ =================================== -Early stopping of Gradient Boosting +Early stopping in Gradient Boosting =================================== Gradient boosting is an ensembling technique where several weak learners From 8ab2435f27276dea07abd1e87844ec27a7259ec9 Mon Sep 17 00:00:00 2001 From: greyisbetter Date: Wed, 20 Sep 2023 13:13:13 +0530 Subject: [PATCH 2/9] small grammatical change --- doc/modules/ensemble.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/modules/ensemble.rst b/doc/modules/ensemble.rst index 5c59eaf804d54..3175a4fff91e8 100644 --- a/doc/modules/ensemble.rst +++ b/doc/modules/ensemble.rst @@ -740,7 +740,7 @@ of ``learning_rate`` require larger numbers of weak learners to maintain a constant training error. Empirical evidence suggests that small values of ``learning_rate`` favor better test error. [HTF]_ recommend to set the learning rate to a small constant -(e.g. ``learning_rate <= 0.1``) and choose ``n_estimators`` by +(e.g. ``learning_rate <= 0.1``) and choose ``n_estimators`` for :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py` . For a more detailed discussion of the interaction between ``learning_rate`` and ``n_estimators`` see [R2007]_. From c2c31cb3c17efb4b917b6842a4f783b002f75713 Mon Sep 17 00:00:00 2001 From: greyisbetter Date: Wed, 20 Sep 2023 22:20:39 +0530 Subject: [PATCH 3/9] add the link to the parameters in the API docs --- .../gradient_boosting.py | 4 ++++ sklearn/linear_model/_passive_aggressive.py | 20 ++++++++++++------- sklearn/linear_model/_perceptron.py | 9 ++++++--- sklearn/linear_model/_stochastic_gradient.py | 11 +++++++--- .../neural_network/_multilayer_perceptron.py | 8 ++++++-- 5 files changed, 37 insertions(+), 15 deletions(-) diff --git a/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py b/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py index c3af930654b73..cd010a5acb326 100644 --- a/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py +++ b/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py @@ -1345,6 +1345,8 @@ class HistGradientBoostingRegressor(RegressorMixin, BaseHistGradientBoosting): If 'auto', early stopping is enabled if the sample size is larger than 10000. If True, early stopping is enabled, otherwise early stopping is disabled. + See also + :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py`. .. versionadded:: 0.23 @@ -1705,6 +1707,8 @@ class HistGradientBoostingClassifier(ClassifierMixin, BaseHistGradientBoosting): If 'auto', early stopping is enabled if the sample size is larger than 10000. If True, early stopping is enabled, otherwise early stopping is disabled. + See also + :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py`. .. versionadded:: 0.23 diff --git a/sklearn/linear_model/_passive_aggressive.py b/sklearn/linear_model/_passive_aggressive.py index d27cc928ca056..733ca76a18c8a 100644 --- a/sklearn/linear_model/_passive_aggressive.py +++ b/sklearn/linear_model/_passive_aggressive.py @@ -35,11 +35,14 @@ class PassiveAggressiveClassifier(BaseSGDClassifier): .. versionadded:: 0.19 early_stopping : bool, default=False - Whether to use early stopping to terminate training when validation. + Whether to use early stopping to terminate training when validation score is not improving. If set to True, it will automatically set aside a stratified fraction of training data as validation and terminate - training when validation score is not improving by at least tol for - n_iter_no_change consecutive epochs. + training when validation score returned by the `score` method is not + improving by at least `tol` for `n_iter_no_change` consecutive + epochs. + See + :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py`. .. versionadded:: 0.20 @@ -342,11 +345,14 @@ class PassiveAggressiveRegressor(BaseSGDRegressor): .. versionadded:: 0.19 early_stopping : bool, default=False - Whether to use early stopping to terminate training when validation. + Whether to use early stopping to terminate training when validation score is not improving. If set to True, it will automatically set aside - a fraction of training data as validation and terminate - training when validation score is not improving by at least tol for - n_iter_no_change consecutive epochs. + a stratified fraction of training data as validation and terminate + training when validation score returned by the `score` method is not + improving by at least `tol` for `n_iter_no_change` consecutive + epochs. + See + :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py`. .. versionadded:: 0.20 diff --git a/sklearn/linear_model/_perceptron.py b/sklearn/linear_model/_perceptron.py index 30e781983365e..67cd5cc89d48f 100644 --- a/sklearn/linear_model/_perceptron.py +++ b/sklearn/linear_model/_perceptron.py @@ -68,11 +68,14 @@ class Perceptron(BaseSGDClassifier): See :term:`Glossary `. early_stopping : bool, default=False - Whether to use early stopping to terminate training when validation. + Whether to use early stopping to terminate training when validation score is not improving. If set to True, it will automatically set aside a stratified fraction of training data as validation and terminate - training when validation score is not improving by at least tol for - n_iter_no_change consecutive epochs. + training when validation score returned by the `score` method is not + improving by at least `tol` for `n_iter_no_change` consecutive + epochs. + See + :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py`. .. versionadded:: 0.20 diff --git a/sklearn/linear_model/_stochastic_gradient.py b/sklearn/linear_model/_stochastic_gradient.py index 8456b3456291a..1f7e05c1953c6 100644 --- a/sklearn/linear_model/_stochastic_gradient.py +++ b/sklearn/linear_model/_stochastic_gradient.py @@ -1059,10 +1059,13 @@ class SGDClassifier(BaseSGDClassifier): early_stopping : bool, default=False Whether to use early stopping to terminate training when validation - score is not improving. If set to `True`, it will automatically set aside + score is not improving. If set to True, it will automatically set aside a stratified fraction of training data as validation and terminate training when validation score returned by the `score` method is not - improving by at least tol for n_iter_no_change consecutive epochs. + improving by at least `tol` for `n_iter_no_change` consecutive + epochs. + See + :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py` .. versionadded:: 0.20 Added 'early_stopping' option @@ -1848,10 +1851,12 @@ class SGDRegressor(BaseSGDRegressor): early_stopping : bool, default=False Whether to use early stopping to terminate training when validation score is not improving. If set to True, it will automatically set aside - a fraction of training data as validation and terminate + a stratified fraction of training data as validation and terminate training when validation score returned by the `score` method is not improving by at least `tol` for `n_iter_no_change` consecutive epochs. + See + :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py`. .. versionadded:: 0.20 Added 'early_stopping' option diff --git a/sklearn/neural_network/_multilayer_perceptron.py b/sklearn/neural_network/_multilayer_perceptron.py index d64593c27d6f5..d76bde3a26027 100644 --- a/sklearn/neural_network/_multilayer_perceptron.py +++ b/sklearn/neural_network/_multilayer_perceptron.py @@ -887,13 +887,15 @@ class MLPClassifier(ClassifierMixin, BaseMultilayerPerceptron): Whether to use early stopping to terminate training when validation score is not improving. If set to true, it will automatically set aside 10% of training data as validation and terminate training when - validation score is not improving by at least tol for - ``n_iter_no_change`` consecutive epochs. The split is stratified, + validation score is not improving by at least `tol` for + `n_iter_no_change` consecutive epochs. The split is stratified, except in a multilabel setting. If early stopping is False, then the training stops when the training loss does not improve by more than tol for n_iter_no_change consecutive passes over the training set. Only effective when solver='sgd' or 'adam'. + See + :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py` validation_fraction : float, default=0.1 The proportion of training data to set aside as validation set for @@ -1383,6 +1385,8 @@ class MLPRegressor(RegressorMixin, BaseMultilayerPerceptron): terminate training when validation score is not improving by at least ``tol`` for ``n_iter_no_change`` consecutive epochs. Only effective when solver='sgd' or 'adam'. + See + :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py`. validation_fraction : float, default=0.1 The proportion of training data to set aside as validation set for From 6b2d3457aee988a764ba905fe9a41d4965c34e9d Mon Sep 17 00:00:00 2001 From: greyisbetter Date: Wed, 20 Sep 2023 22:55:41 +0530 Subject: [PATCH 4/9] adjust linting --- sklearn/linear_model/_stochastic_gradient.py | 24 ++++++++------------ 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/sklearn/linear_model/_stochastic_gradient.py b/sklearn/linear_model/_stochastic_gradient.py index 1f7e05c1953c6..a7106cb7c260d 100644 --- a/sklearn/linear_model/_stochastic_gradient.py +++ b/sklearn/linear_model/_stochastic_gradient.py @@ -711,11 +711,9 @@ def _fit( and self.n_iter_ == self.max_iter ): warnings.warn( - ( - "Maximum number of iteration reached before " - "convergence. Consider increasing max_iter to " - "improve the fit." - ), + "Maximum number of iteration reached before " + "convergence. Consider increasing max_iter to " + "improve the fit.", ConvergenceWarning, ) return self @@ -1562,11 +1560,9 @@ def _fit( and self.n_iter_ == self.max_iter ): warnings.warn( - ( - "Maximum number of iteration reached before " - "convergence. Consider increasing max_iter to " - "improve the fit." - ), + "Maximum number of iteration reached before " + "convergence. Consider increasing max_iter to " + "improve the fit.", ConvergenceWarning, ) @@ -2452,11 +2448,9 @@ def _fit( and self.n_iter_ == self.max_iter ): warnings.warn( - ( - "Maximum number of iteration reached before " - "convergence. Consider increasing max_iter to " - "improve the fit." - ), + "Maximum number of iteration reached before " + "convergence. Consider increasing max_iter to " + "improve the fit.", ConvergenceWarning, ) From 4c80986bd6f9d13aed6c514c90c07932a77e3b9f Mon Sep 17 00:00:00 2001 From: greyisbetter Date: Wed, 20 Sep 2023 23:49:04 +0530 Subject: [PATCH 5/9] making docs more informative --- doc/modules/ensemble.rst | 5 +++-- sklearn/linear_model/_stochastic_gradient.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/modules/ensemble.rst b/doc/modules/ensemble.rst index 3175a4fff91e8..63fb371a5ac07 100644 --- a/doc/modules/ensemble.rst +++ b/doc/modules/ensemble.rst @@ -740,8 +740,9 @@ of ``learning_rate`` require larger numbers of weak learners to maintain a constant training error. Empirical evidence suggests that small values of ``learning_rate`` favor better test error. [HTF]_ recommend to set the learning rate to a small constant -(e.g. ``learning_rate <= 0.1``) and choose ``n_estimators`` for -:ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py` +(e.g. ``learning_rate <= 0.1``) and choose ``n_estimators`` large enough +that early stopping applies, +see :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py` . For a more detailed discussion of the interaction between ``learning_rate`` and ``n_estimators`` see [R2007]_. diff --git a/sklearn/linear_model/_stochastic_gradient.py b/sklearn/linear_model/_stochastic_gradient.py index a7106cb7c260d..d4b87ce511723 100644 --- a/sklearn/linear_model/_stochastic_gradient.py +++ b/sklearn/linear_model/_stochastic_gradient.py @@ -1063,7 +1063,7 @@ class SGDClassifier(BaseSGDClassifier): improving by at least `tol` for `n_iter_no_change` consecutive epochs. See - :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py` + :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py`. .. versionadded:: 0.20 Added 'early_stopping' option From 8dbc2388a387d731e3981782fde2f9020fe288ec Mon Sep 17 00:00:00 2001 From: greyisbetter Date: Mon, 25 Sep 2023 17:54:55 +0530 Subject: [PATCH 6/9] add link only in gradient boosting docs --- doc/modules/ensemble.rst | 2 +- sklearn/linear_model/_passive_aggressive.py | 18 ++++------ sklearn/linear_model/_perceptron.py | 7 ++-- sklearn/linear_model/_stochastic_gradient.py | 35 ++++++++++--------- .../neural_network/_multilayer_perceptron.py | 7 ++-- 5 files changed, 29 insertions(+), 40 deletions(-) diff --git a/doc/modules/ensemble.rst b/doc/modules/ensemble.rst index 63fb371a5ac07..2d1f05f230ed4 100644 --- a/doc/modules/ensemble.rst +++ b/doc/modules/ensemble.rst @@ -743,7 +743,7 @@ recommend to set the learning rate to a small constant (e.g. ``learning_rate <= 0.1``) and choose ``n_estimators`` large enough that early stopping applies, see :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py` -. For a more detailed discussion of the interaction between +for a more detailed discussion of the interaction between ``learning_rate`` and ``n_estimators`` see [R2007]_. Subsampling diff --git a/sklearn/linear_model/_passive_aggressive.py b/sklearn/linear_model/_passive_aggressive.py index 733ca76a18c8a..68237ade18bb5 100644 --- a/sklearn/linear_model/_passive_aggressive.py +++ b/sklearn/linear_model/_passive_aggressive.py @@ -38,11 +38,8 @@ class PassiveAggressiveClassifier(BaseSGDClassifier): Whether to use early stopping to terminate training when validation score is not improving. If set to True, it will automatically set aside a stratified fraction of training data as validation and terminate - training when validation score returned by the `score` method is not - improving by at least `tol` for `n_iter_no_change` consecutive - epochs. - See - :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py`. + training when validation score is not improving by at least `tol` for + `n_iter_no_change` consecutive epochs. .. versionadded:: 0.20 @@ -345,14 +342,11 @@ class PassiveAggressiveRegressor(BaseSGDRegressor): .. versionadded:: 0.19 early_stopping : bool, default=False - Whether to use early stopping to terminate training when validation + Whether to use early stopping to terminate training when validation. score is not improving. If set to True, it will automatically set aside - a stratified fraction of training data as validation and terminate - training when validation score returned by the `score` method is not - improving by at least `tol` for `n_iter_no_change` consecutive - epochs. - See - :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py`. + a fraction of training data as validation and terminate + training when validation score is not improving by at least tol for + n_iter_no_change consecutive epochs. .. versionadded:: 0.20 diff --git a/sklearn/linear_model/_perceptron.py b/sklearn/linear_model/_perceptron.py index 67cd5cc89d48f..eaf3da556b24a 100644 --- a/sklearn/linear_model/_perceptron.py +++ b/sklearn/linear_model/_perceptron.py @@ -71,11 +71,8 @@ class Perceptron(BaseSGDClassifier): Whether to use early stopping to terminate training when validation score is not improving. If set to True, it will automatically set aside a stratified fraction of training data as validation and terminate - training when validation score returned by the `score` method is not - improving by at least `tol` for `n_iter_no_change` consecutive - epochs. - See - :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py`. + training when validation score is not improving by at least `tol` for + `n_iter_no_change` consecutive epochs. .. versionadded:: 0.20 diff --git a/sklearn/linear_model/_stochastic_gradient.py b/sklearn/linear_model/_stochastic_gradient.py index d4b87ce511723..8456b3456291a 100644 --- a/sklearn/linear_model/_stochastic_gradient.py +++ b/sklearn/linear_model/_stochastic_gradient.py @@ -711,9 +711,11 @@ def _fit( and self.n_iter_ == self.max_iter ): warnings.warn( - "Maximum number of iteration reached before " - "convergence. Consider increasing max_iter to " - "improve the fit.", + ( + "Maximum number of iteration reached before " + "convergence. Consider increasing max_iter to " + "improve the fit." + ), ConvergenceWarning, ) return self @@ -1057,13 +1059,10 @@ class SGDClassifier(BaseSGDClassifier): early_stopping : bool, default=False Whether to use early stopping to terminate training when validation - score is not improving. If set to True, it will automatically set aside + score is not improving. If set to `True`, it will automatically set aside a stratified fraction of training data as validation and terminate training when validation score returned by the `score` method is not - improving by at least `tol` for `n_iter_no_change` consecutive - epochs. - See - :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py`. + improving by at least tol for n_iter_no_change consecutive epochs. .. versionadded:: 0.20 Added 'early_stopping' option @@ -1560,9 +1559,11 @@ def _fit( and self.n_iter_ == self.max_iter ): warnings.warn( - "Maximum number of iteration reached before " - "convergence. Consider increasing max_iter to " - "improve the fit.", + ( + "Maximum number of iteration reached before " + "convergence. Consider increasing max_iter to " + "improve the fit." + ), ConvergenceWarning, ) @@ -1847,12 +1848,10 @@ class SGDRegressor(BaseSGDRegressor): early_stopping : bool, default=False Whether to use early stopping to terminate training when validation score is not improving. If set to True, it will automatically set aside - a stratified fraction of training data as validation and terminate + a fraction of training data as validation and terminate training when validation score returned by the `score` method is not improving by at least `tol` for `n_iter_no_change` consecutive epochs. - See - :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py`. .. versionadded:: 0.20 Added 'early_stopping' option @@ -2448,9 +2447,11 @@ def _fit( and self.n_iter_ == self.max_iter ): warnings.warn( - "Maximum number of iteration reached before " - "convergence. Consider increasing max_iter to " - "improve the fit.", + ( + "Maximum number of iteration reached before " + "convergence. Consider increasing max_iter to " + "improve the fit." + ), ConvergenceWarning, ) diff --git a/sklearn/neural_network/_multilayer_perceptron.py b/sklearn/neural_network/_multilayer_perceptron.py index d76bde3a26027..b9d9860cde213 100644 --- a/sklearn/neural_network/_multilayer_perceptron.py +++ b/sklearn/neural_network/_multilayer_perceptron.py @@ -887,15 +887,12 @@ class MLPClassifier(ClassifierMixin, BaseMultilayerPerceptron): Whether to use early stopping to terminate training when validation score is not improving. If set to true, it will automatically set aside 10% of training data as validation and terminate training when - validation score is not improving by at least `tol` for - `n_iter_no_change` consecutive epochs. The split is stratified, + validation score is not improving by at least ``tol`` for + ``n_iter_no_change`` consecutive epochs. The split is stratified, except in a multilabel setting. If early stopping is False, then the training stops when the training loss does not improve by more than tol for n_iter_no_change consecutive passes over the training set. - Only effective when solver='sgd' or 'adam'. - See - :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py` validation_fraction : float, default=0.1 The proportion of training data to set aside as validation set for From 32bfcf5fe7d96595dc5f1d4a465d9fcaba96e725 Mon Sep 17 00:00:00 2001 From: greyisbetter Date: Tue, 26 Sep 2023 11:05:36 +0530 Subject: [PATCH 7/9] remove link from HistGradientBoosting and add only to GradientBoosting --- sklearn/ensemble/_gb.py | 4 ++++ sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sklearn/ensemble/_gb.py b/sklearn/ensemble/_gb.py index e198babdb28d7..e3d4515e1694d 100644 --- a/sklearn/ensemble/_gb.py +++ b/sklearn/ensemble/_gb.py @@ -1282,6 +1282,8 @@ class GradientBoostingClassifier(ClassifierMixin, BaseGradientBoosting): improving in all of the previous ``n_iter_no_change`` numbers of iterations. The split is stratified. Values must be in the range `[1, inf)`. + See + :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py`. .. versionadded:: 0.20 @@ -1891,6 +1893,8 @@ class GradientBoostingRegressor(RegressorMixin, BaseGradientBoosting): improving in all of the previous ``n_iter_no_change`` numbers of iterations. Values must be in the range `[1, inf)`. + See + :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py`. .. versionadded:: 0.20 diff --git a/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py b/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py index cd010a5acb326..c3af930654b73 100644 --- a/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py +++ b/sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py @@ -1345,8 +1345,6 @@ class HistGradientBoostingRegressor(RegressorMixin, BaseHistGradientBoosting): If 'auto', early stopping is enabled if the sample size is larger than 10000. If True, early stopping is enabled, otherwise early stopping is disabled. - See also - :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py`. .. versionadded:: 0.23 @@ -1707,8 +1705,6 @@ class HistGradientBoostingClassifier(ClassifierMixin, BaseHistGradientBoosting): If 'auto', early stopping is enabled if the sample size is larger than 10000. If True, early stopping is enabled, otherwise early stopping is disabled. - See also - :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py`. .. versionadded:: 0.23 From ad06da73858cb3c0ca90a9b8fbe81892cda407f1 Mon Sep 17 00:00:00 2001 From: greyisbetter Date: Tue, 26 Sep 2023 11:09:41 +0530 Subject: [PATCH 8/9] minor adjustments --- sklearn/neural_network/_multilayer_perceptron.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/sklearn/neural_network/_multilayer_perceptron.py b/sklearn/neural_network/_multilayer_perceptron.py index b9d9860cde213..8b88663b3d62f 100644 --- a/sklearn/neural_network/_multilayer_perceptron.py +++ b/sklearn/neural_network/_multilayer_perceptron.py @@ -1382,8 +1382,6 @@ class MLPRegressor(RegressorMixin, BaseMultilayerPerceptron): terminate training when validation score is not improving by at least ``tol`` for ``n_iter_no_change`` consecutive epochs. Only effective when solver='sgd' or 'adam'. - See - :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_early_stopping.py`. validation_fraction : float, default=0.1 The proportion of training data to set aside as validation set for From 902c6cea6bc9bf7e0f271ecfa28661075def3339 Mon Sep 17 00:00:00 2001 From: greyisbetter Date: Thu, 28 Sep 2023 22:45:16 +0530 Subject: [PATCH 9/9] discard irrelevant changes --- sklearn/neural_network/_multilayer_perceptron.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sklearn/neural_network/_multilayer_perceptron.py b/sklearn/neural_network/_multilayer_perceptron.py index 8b88663b3d62f..02303006dd91c 100644 --- a/sklearn/neural_network/_multilayer_perceptron.py +++ b/sklearn/neural_network/_multilayer_perceptron.py @@ -893,6 +893,7 @@ class MLPClassifier(ClassifierMixin, BaseMultilayerPerceptron): If early stopping is False, then the training stops when the training loss does not improve by more than tol for n_iter_no_change consecutive passes over the training set. + Only effective when solver='sgd' or 'adam'. validation_fraction : float, default=0.1 The proportion of training data to set aside as validation set for