Skip to content

min_weight_fraction_leaf has no effect on DecisionTreeClassifier #7224

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

Closed
amueller opened this issue Aug 22, 2016 · 2 comments
Closed

min_weight_fraction_leaf has no effect on DecisionTreeClassifier #7224

amueller opened this issue Aug 22, 2016 · 2 comments

Comments

@amueller
Copy link
Member

From the docstring I would expect min_weight_fraction_leaf to have a similar effect as min_samples_leaf, but it doesn't, as shown by the code below:

from sklearn.datasets import load_digits
from sklearn.tree import DecisionTreeClassifier
import numpy as np

data = load_digits(10)
features, labels = data.data, data.target
tree = DecisionTreeClassifier(random_state=10, min_weight_fraction_leaf=0.2).fit(features, labels)
tree.tree_.value.sum(axis=2).min()

1

There is leafs with single data points, but that's less than 0.2 * n_samples.
@rhiever reported this.
Ping @arjoly @glouppe @jmschrei

@nelson-liu
Copy link
Contributor

seems related to #6945

@amueller
Copy link
Member Author

indeed, thanks @nelson-liu.

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

No branches or pull requests

2 participants