-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
DOC added links to plot_gradient_boosting_regularization.py and plot_gradient_boosting_categorical.py #30749
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR @Siniade!
I have a few comments:
sklearn/ensemble/_gb.py
Outdated
See :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_regularization.py` | ||
for an example on using regularization with Gradient Boosting. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this example here since the linked resource is about classifiers, whereas the docstring refers to a regressor. The relevant example is already covered by plot_gradient_boosting_regression.py
, which is included in the docstring of GradientBoostingRegressor
.
sklearn/ensemble/_gb.py
Outdated
See :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_oob.py` for | ||
an example on using Out-of-Bag estimates to estimate the optimal number of | ||
iterations for Gradient Boosting. | ||
See | ||
:ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_regularization.py` | ||
for an example on using regularization with Gradient Boosting. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please move these two examples to the end of the docstring? You can refer to how plot_gradient_boosting_regression.py
is placed in the GradientBoostingRegressor
docstring.
See :ref:`sphx_glr_auto_examples_ensemble_plot_hgbt_regression.py` for a | ||
usecase example of this feature. | ||
usecase example of this feature. See | ||
:ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_categorical.py` | ||
for an example using histogram-based gradient boosting on categorical features. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind placing these two examples at the end of the docstring? You can follow the placement of plot_gradient_boosting_regression.py
in the GradientBoostingRegressor
docstring as a reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. The first example was already present and is related to the paragraph that precedes it. Do you want me to move the first examples also in that case or should I let that be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the catch! You can leave the first example where it is.
Thanks for your suggestions! I have made the updates |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for updating the PR @Siniade!
I have a few more comments.
sklearn/ensemble/_gb.py
Outdated
iterations for Gradient Boosting. For a detailed example of utilizing | ||
regularization with | ||
:class:`~sklearn.ensemble.GradientBoostingClassifier`, please refer to | ||
:ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_regularization.py`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please separate this example into a new paragraph?
doc/modules/ensemble.rst
Outdated
``learning_rate`` and ``n_estimators`` see [R2007]_. Also see :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_regularization.py` | ||
for an example on how regularization via shrinkage impacts Gradient Boosting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please move
"Also see :ref:sphx_glr_auto_examples_ensemble_plot_gradient_boosting_regularization.py
"
to the next line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I have committed the updated changes.
1b85e0a
to
d2e04e0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @Siniade!
@adrinjalali, @marenwestermann, would you like to take a look and merge it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've applied my comments directly here. Thanks for the PR @Siniade
doc/modules/ensemble.rst
Outdated
Also see :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_regularization.py` | ||
for an example on how regularization via shrinkage impacts Gradient Boosting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
already mentioned in the next section, so removing
sklearn/ensemble/_gb.py
Outdated
For a detailed example of utilizing regularization with | ||
:class:`~sklearn.ensemble.GradientBoostingClassifier`, please refer to | ||
:ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_regularization.py`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moving this to the parameter docstring
sklearn/ensemble/_gb.py
Outdated
See :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_oob.py` for | ||
an example on using Out-of-Bag estimates to estimate the optimal number of | ||
iterations for Gradient Boosting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this example is linked from the user guide, and needs improvements, then we can think of adding it in the docstring, so removing it from here
See :ref:`sphx_glr_auto_examples_ensemble_plot_gradient_boosting_categorical.py` | ||
for an example using histogram-based gradient boosting on categorical features. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moving to the parameter's docstring.
Reference Issues/PRs
Towards #30621 - Linked examples for
plot_gradient_boosting_categorical.py
,plot_gradient_boosting_oob.py
, andplot_gradient_boosting_regularization.py
fromexamples/ensemble
.What does this implement/fix? Explain your changes.
plot_gradient_boosting_categorical.py
plot_gradient_boosting_oob.py
plot_gradient_boosting_regularization.py
Any other comments?