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

Skip to content

[MRG] Change deprecation for min_impurity_split from removal to changing the default #12400

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

Conversation

NicolasHug
Copy link
Member

@NicolasHug NicolasHug commented Oct 17, 2018

Reference Issues/PRs

Addresses #12240 (comment)

What does this implement/fix? Explain your changes.

min_impurity_split is deprecated but still defaults to 1e-7 when not set, even if the user sets min_impurity_decrease. This PR adds a ChangedBehaviorWarning indicating results may change when min_impurity_split is actually removed.

Any other comments?

@jnothman
Copy link
Member

jnothman commented Oct 18, 2018 via email

@amueller
Copy link
Member

The user will still not be able to reproduce the old behavior but I guess at least they'll have a year or so to fix it.
I'm fine with going that way.
But then what do we tell users? I mean they shouldn't be setting it now since it's deprecated. But if they don't set it, how can they avoid the deprecation warning?
Or do we add two more cycles, one changing the default to 0 and one deprecating the parameter?

@NicolasHug
Copy link
Member Author

NicolasHug commented Oct 18, 2018

The message says to set it to -inf to avoid both warnings, but that means the code will break in 0.21 :/

@jnothman
Copy link
Member

jnothman commented Oct 21, 2018 via email

@amueller
Copy link
Member

amueller commented Oct 22, 2018

I guess that's the cleanest way. @NicolasHug clear what to do? For now we basically change the warning saying that the parameter is deprecated, will change to -inf in 0.23 and it will be removed in 0.25.

@amueller
Copy link
Member

Is there a difference between 0 and -inf?

@NicolasHug
Copy link
Member Author

Ok got it.

Is there a difference between 0 and -inf?

Any negative value would raise an error anyway (except in my current changes which I will revert)

Threshold for early stopping in tree growth. A node will split
if its impurity is above the threshold, otherwise it is a leaf.

.. deprecated:: 0.19
``min_impurity_split`` has been deprecated in favor of
``min_impurity_decrease`` in 0.19 and will be removed in 0.21.
Use ``min_impurity_decrease`` instead.
``min_impurity_decrease`` in 0.19 and will be removed in 0.25.
Copy link
Member

Choose a reason for hiding this comment

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

I would say this in the order

``min_impurity_split`` has been deprecated in favor of ``min_impurity_decrease`` in 0.19. The default value of ``min_impurity_split`` will change from 1e-7 to 0 in 0.23 and will be removed in 0.25. Use ``min_impurity_decrease`` instead.

" will be removed in version 0.21. "
warnings.warn("The min_impurity_split parameter is deprecated. "
"Its default value will change from 1e-7 to 0 in "
"version 0.23, and will be removed in 0.25. "
Copy link
Member

Choose a reason for hiding this comment

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

"it will be removed"?

@amueller
Copy link
Member

slight change suggested in the wording, otherwise looks good :)

@amueller amueller added this to the 0.20.1 milestone Nov 16, 2018
Copy link
Member

@amueller amueller left a comment

Choose a reason for hiding this comment

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

thanks!

@amueller
Copy link
Member

@jnothman @ogrisel @rth I forgot about this one, we need it for 0.20.1

@jnothman
Copy link
Member

Can you please rename the PR to something more appropriate for the commit logs, @NicolasHug?

@NicolasHug NicolasHug changed the title [MRG] Added ChangedBehaviorWarning to decision tree for min_impurity_split [MRG] Updated DeprecationWarning message for min_impurity_split parameter in decision trees Nov 18, 2018
@amueller amueller changed the title [MRG] Updated DeprecationWarning message for min_impurity_split parameter in decision trees [MRG] Change deprecation for min_impurity_split from removal to changing the default Nov 19, 2018
@amueller
Copy link
Member

@jnothman better?
Also you can change that when doing squash and merge, right?

@jnothman
Copy link
Member

Yes, you can change that when doing squash and merge, but I had writer's block

@jnothman jnothman merged commit 4ab6055 into scikit-learn:master Nov 19, 2018
@jnothman
Copy link
Member

Thanks @NicolasHug

jnothman pushed a commit to jnothman/scikit-learn that referenced this pull request Nov 20, 2018
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
koenvandevelde pushed a commit to koenvandevelde/scikit-learn that referenced this pull request Jul 12, 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