Skip to content

Adds example for tree.ExtraTreeRegressor #15213

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

th0rwas
Copy link
Contributor

@th0rwas th0rwas commented Oct 12, 2019

Toward #3846

this PR adds an example to tree.ExtraTreeRegressor

@thomasjpfan
Copy link
Member

Thank you for the PR @th0rwas .

I am unsure of having an example, when the ExtraTreeRegressor is recommended to "only be used within ensemble methods".

@th0rwas
Copy link
Contributor Author

th0rwas commented Oct 12, 2019

Thanks, that sounds pretty reasonable. I'll revise the example and will use it within an ensemble context then.

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.

LGTM, thanks @th0rwas

>>> X, y = load_boston(return_X_y=True)
>>> extra_tree = ExtraTreeRegressor() # doctest: +ELLIPSIS
>>> reg = BaggingRegressor(extra_tree, n_estimators=10, random_state=0)
>>> cross_val_score(reg, X, y, cv=5)
Copy link
Member

Choose a reason for hiding this comment

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

Using cross_val_score for a example in the docstring seems a little too computational intensive. I'll be okay with fit on a train set and score on a test set.

@adrinjalali
Copy link
Member

You have merge conflicts @th0rwas , do you need help fixing them?

th0rwas and others added 3 commits October 29, 2019 20:40
Co-Authored-By: Thomas J Fan <thomasjpfan@gmail.com>
single evaluation score instead of cross_val_score
@th0rwas
Copy link
Contributor Author

th0rwas commented Oct 29, 2019

@adrinjalali Yes thank you, that would be great. I tried implementing the proposed changes - getting rid of cross_val_score for a lighter alternative but now receiving CI failure. I guess I need to merge upstream into my branch to get rid of this - I will try fixing this tomorrow.

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.

Will merge when green

@qinhanmin2014 qinhanmin2014 merged commit 6024894 into scikit-learn:master Nov 19, 2019
adrinjalali pushed a commit to adrinjalali/scikit-learn that referenced this pull request Nov 25, 2019
panpiort8 pushed a commit to panpiort8/scikit-learn that referenced this pull request Mar 3, 2020
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.

4 participants