Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC remove FutureWarnings from plot_stack_predictors #24918

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 2 commits into from
Nov 15, 2022

Conversation

edenies
Copy link
Contributor

@edenies edenies commented Nov 14, 2022

Reference Issues/PRs

What does this implement/fix? Explain your changes.

Fixes the task ensemble/plot_stack_predictors.html of the issue #24876 .

Any other comments?

This PR fixes the FutureWarning linked to the usage of series[i:j]. The last keyword is replaced by series.iloc[i:j] making the Depreciation Warning go away.

Comment on lines 78 to 79
X = X[:600]
y = y[:600]
y = y.iloc[:600]
Copy link
Member

Choose a reason for hiding this comment

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

We should probably be more explicit here. I am not sure that everyone knows what happens when slicing a dataframe with integers :)

Let's do the following to be extra explicit:

    X = X.loc[:, features]
    X, y = shuffle(X, y, random_state=0)

    X = X.iloc[:600]
    y = y.iloc[:600]

@glemaitre glemaitre changed the title DOC - FutureWarning plot_stack_predictors DOC remove FutureWarnings from plot_stack_predictors Nov 15, 2022
@glemaitre
Copy link
Member

The error in the linter is not linked to this PR. LGTM. Merging

@glemaitre glemaitre merged commit 498abaa into scikit-learn:main Nov 15, 2022
@MaximSmolskiy
Copy link
Contributor

The error in the linter is not linked to this PR. LGTM. Merging

@glemaitre There was linter error in this PR - there was no whitespace between comma and variable name in:
X = X.loc[:,features].
Unfortunately, now this error in main branch.

@glemaitre
Copy link
Member

Thanks. I just pushed a fix in main. I should have at least wait for the linting, my bad.

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.

5 participants