-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
DOC add BaggingClassifier Examples #14923
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
I honestly don't understand why the classifier output for the Doctest fails in the azure pipeline. I could use some clarification on those. |
Azure Pipeline partially breaks on the pprint Left the response in as a comment, I think they make the use a bit clearer
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 :)
Co-Authored-By: Adrin Jalali <adrin.jalali@gmail.com>
Thank you for your help @adrinjalali |
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.
Nit, otherwise LGTM. Thanks @JesperDramsch
sklearn/ensemble/bagging.py
Outdated
... n_informative=2, n_redundant=0, | ||
... random_state=0, shuffle=False) | ||
>>> clf = BaggingClassifier(n_estimators=100, random_state=0).fit(X, y) | ||
>>> print(clf.predict([[0, 0, 0, 0]])) |
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.
You don't need to print
, you would see the output in the REPL anyway.
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 know, I just followed the suggestion from your last review. Should I revert this?
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.
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.
Ha. I got confused, sorry about that.
Tests failing because when you remove the print, the output becomes |
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, thanks @JesperDramsch
sklearn/ensemble/bagging.py
Outdated
@@ -541,6 +541,23 @@ class BaggingClassifier(ClassifierMixin, BaseBagging): | |||
`oob_decision_function_` might contain NaN. This attribute exists | |||
only when ``oob_score`` is True. | |||
|
|||
|
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.
extra 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.
Thanks @JesperDramsch !
Toward #3846
this PR adds an example to
ensemble.BaggingClassifier
ping @adrinjalali