8000 DOC add BaggingClassifier Examples by JesperDramsch · Pull Request #14923 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 7 commits into from
Oct 7, 2019
Merged

Conversation

JesperDramsch
Copy link
Contributor

Toward #3846
this PR adds an example to ensemble.BaggingClassifier

ping @adrinjalali

@JesperDramsch
Copy link
Contributor Author

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
Copy link
Member
@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :)

JesperDramsch and others added 2 commits October 2, 2019 11:48
Co-Authored-By: Adrin Jalali <adrin.jalali@gmail.com>
@JesperDramsch
Copy link
Contributor Author

Thank you for your help @adrinjalali

Copy link
Member
@adrinjalali adrinjalali left a 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

... 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]]))
Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought my suggestion was to remove it :P

suggestion

< 10000 /span> Copy link
Contributor Author

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.

@adrinjalali
Copy link
Member

Tests failing because when you remove the print, the output becomes array([1]) instead of [1]. You need to fix the outputs as well :)

Copy link
Member
@adrinjalali adrinjalali left a 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

@@ -541,6 +541,23 @@ class BaggingClassifier(ClassifierMixin, BaseBagging):
`oob_decision_function_` might contain NaN. This attribute exists
only when ``oob_score`` is True.


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra line

Copy link
Member
@rth rth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @JesperDramsch !

@rth rth changed the title add BaggingClassifier Examples DOC add BaggingClassifier Examples Oct 7, 2019
@rth rth merged commit c6b5eb2 into scikit-learn:master Oct 7, 2019
@JesperDramsch JesperDramsch deleted the bagclf branch October 7, 2019 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0