8000 [MRG] Add an example for ensemble.BaggingRegressor by steinfurt · Pull Request #15196 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

[MRG] Add an example for ensemble.BaggingRegressor #15196

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

Conversation

steinfurt
Copy link
Contributor

See also #3846

Implements a simple example/doctest for ensemble.BaggingRegressor and speeds up the test for ensemble.BaggingClassifier somewhat.

ping @adrinjalali

... random_state=0, shuffle=False)
>>> regr = BaggingRegressor(n_estimators=10, random_state=0).fit(X, y)
>>> regr.predict([[0, 0, 0, 0]])
array([2.36503199])
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
array([2.36503199])
array([2.3650...])

>>> regr = BaggingRegressor(base_estimator=SVR(),
... n_estimators=10, random_state=0).fit(X, y)
>>> regr.predict([[0, 0, 0, 0]])
array([-2.87202411])
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
array([-2.87202411])
array([-2.8720...])

Comment on lines 946 to 948
>>> regr = BaggingRegressor(n_estimators=10, random_state=0).fit(X, y)
>>> regr.predict([[0, 0, 0, 0]])
array([2.36503199])
Copy link
Member

Choose a reason for hiding this comment

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

you probably don't need this part, I'm happy to have only the SVR part.

Copy link
Contributor Author
@steinfurt steinfurt Oct 18, 2019

Choose a reason for hiding this comment

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

Ok, I also removed the second one from the BaggingClassifier example.

@steinfurt steinfurt force-pushed the ensemble_bagging_doctests branch from 2d768b9 to 157b730 Compare October 18, 2019 21:53
Copy link
Member
@qinhanmin2014 qinhanmin2014 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @steinfurt

@qinhanmin2014 qinhanmin2014 merged commit bc3a7e1 into scikit-learn:master Oct 21, 2019
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