Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

DOC use diagram and simplify pipeline in stacking example #18830

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 11 commits into from
Feb 1, 2021

Conversation

glemaitre
Copy link
Member

Improve the stacking example by showing the different pipelines with diagrams.
In addition, we do not list the categories beforehand in the OrdinalEncoder to use the new feature of a rare category.
Besides, we let the encoder treat np.nan as a separate category without imputing a new string.

for cat in categories:
cat[cat == None] = 'missing' # noqa
tree_preprocessor = make_column_transformer(
(num_tree_processor, num_cols),
Copy link
Member

Choose a reason for hiding this comment

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

why not cat_selector and num_selector here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I illustrated l.90 that it gives the columns name and reuse the columns then.

Copy link
Member

Choose a reason for hiding this comment

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

fair, but it would also be nice to show off the callable option which I don't think many people know about... I could go either way on this one though.

Copy link
Member

Choose a reason for hiding this comment

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

I am okay either way.

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

Overall, this is a nice update to this example.

examples/ensemble/plot_stack_predictors.py Outdated Show resolved Hide resolved
for cat in categories:
cat[cat == None] = 'missing' # noqa
tree_preprocessor = make_column_transformer(
(num_tree_processor, num_cols),
Copy link
Member

Choose a reason for hiding this comment

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

I am okay either way.

examples/ensemble/plot_stack_predictors.py Outdated Show resolved Hide resolved
examples/ensemble/plot_stack_predictors.py Show resolved Hide resolved
Base automatically changed from master to main January 22, 2021 10:53
Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

Minor comments, otherwise LGTM

examples/ensemble/plot_stack_predictors.py Outdated Show resolved Hide resolved
examples/ensemble/plot_stack_predictors.py Outdated Show resolved Hide resolved
glemaitre and others added 2 commits January 28, 2021 22:23
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
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 it's indeed much clearer with diagrams. Will fix the minor typo below.

examples/ensemble/plot_stack_predictors.py Outdated Show resolved Hide resolved
examples/ensemble/plot_stack_predictors.py Outdated Show resolved Hide resolved
@rth rth merged commit 94b81ab into scikit-learn:main Feb 1, 2021
@glemaitre glemaitre mentioned this pull request Apr 22, 2021
12 tasks
glemaitre added a commit to glemaitre/scikit-learn that referenced this pull request Apr 22, 2021
…rn#18830)

Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
glemaitre added a commit that referenced this pull request Apr 28, 2021
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.