-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Added link to plot_adaboost_multiclass.py example #27913
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
in _weight_boosting.py.
Hello @marenwestermann, Thank you for the reference, it's really helpful. I've moved the example link from the example itself to the doc string in |
sklearn/ensemble/_weight_boosting.py
Outdated
@@ -351,6 +351,9 @@ class AdaBoostClassifier( | |||
|
|||
Read more in the :ref:`User Guide <adaboost>`. | |||
|
|||
For more example of usage, see |
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.
It's better to put the reference under the "Examples" section and write something like
For an example of how AdaBoost is used to fit a sequence of Decision Trees, refer to :ref:`sphx_glr_auto_examples_ensemble_plot_adaboost_multiclass.py`.
It would also be good to leave a reference in the doc string of the DecisionTreeClassifier estimator under the "Notes" or "Examples" section.
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 writing back!
The following files are modified:
ensemble\_weight_boosting.py
: Reworked the example reference and moved it below the Example
section.
tree\_classes.py
: Added the example reference of using AdaBoost with decision trees for the DecisionTree
class.
Please let me know if you need anything else.
`ensemble/_weight_boosting.py` file, moving it below the `Examples` section for improved organization. Included an AdaBoost example reference within the DecisionTree class in the `tree/-class.py` file.
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.
Apologies for the belated reply. I added a small comment (see below). Additionally it would be good to add a link to the example to this section of the user guide which you can find in the code here. Just add the link to this example to the examples that are already listed there.
sklearn/ensemble/_weight_boosting.py
Outdated
@@ -478,6 +478,9 @@ class AdaBoostClassifier( | |||
array([1]) | |||
>>> clf.score(X, y) | |||
0.96... | |||
|
|||
For an example of using AdaBoost to fit a sequence of DecisionTrees as weak learners, |
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 just realised that if estimator=None
as is the case here, the base estimator is DecisionTreeClassifier. So it would be better to write For a detailed example ...
.
…sion Trees user guide. - Modified the doc-string wording in the `AdaBoostClassifier` class referencing to the aforementioned example.
Thank you for the reply. I have updated the following files:
Please let me know if I missed anything. |
Thank you for the update @virchan. Can you fix the linting issue? When you click on the details under "ci/circleci: lint" in the code checks you'll see the error messages. |
Thank you for the follow-up! The linting issue is fixed, all checks have passed. |
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.
Otherwise LGTM.
For a detailed example of using AdaBoost to fit a sequence of DecisionTrees | ||
as weaklearners, please refer to | ||
:ref:`sphx_glr_auto_examples_ensemble_plot_adaboost_multiclass.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.
I think this is the only place where the mention makes sense. I would then remove the other two mentions in this PR.
Hello, Thank you for the feedback! The example references are removed from the Please let me know if there is anything else. |
Reference Issues/PRs
Towards #26927
What does this implement/fix? Explain your changes.
Includes a link to the
plot_adaboost_multiclass.py
exampleAny other comments?
NA