{"action":"created","issue":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/6945","repository_url":"https://api.github.com/repos/scikit-learn/scikit-learn","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/6945/labels{/name}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/6945/comments","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/6945/events","html_url":"https://github.com/scikit-learn/scikit-learn/issues/6945","id":162775028,"number":6945,"title":"min_weight_fraction_leaf suggested improvements","user":{"login":"ben519","id":723099,"avatar_url":"https://avatars1.githubusercontent.com/u/723099?v=3","gravatar_id":"","url":"https://api.github.com/users/ben519","html_url":"https://github.com/ben519","followers_url":"https://api.github.com/users/ben519/followers","following_url":"https://api.github.com/users/ben519/following{/other_user}","gists_url":"https://api.github.com/users/ben519/gists{/gist_id}","starred_url":"https://api.github.com/users/ben519/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ben519/subscriptions","organizations_url":"https://api.github.com/users/ben519/orgs","repos_url":"https://api.github.com/users/ben519/repos","events_url":"https://api.github.com/users/ben519/events{/privacy}","received_events_url":"https://api.github.com/users/ben519/received_events","type":"User","site_admin":false},"labels":[{"id":12995755,"url":"https://api.github.com/repos/scikit-learn/scikit-learn/labels/Bug","name":"Bug","color":"e10c02","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones/18","html_url":"https://github.com/scikit-learn/scikit-learn/milestone/18","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones/18/labels","id":1314892,"number":18,"title":"0.18","description":"","creator":{"login":"amueller","id":449558,"avatar_url":"https://avatars0.githubusercontent.com/u/449558?v=3","gravatar_id":"","url":"https://api.github.com/users/amueller","html_url":"https://github.com/amueller","followers_url":"https://api.github.com/users/amueller/followers","following_url":"https://api.github.com/users/amueller/following{/other_user}","gists_url":"https://api.github.com/users/amueller/gists{/gist_id}","starred_url":"https://api.github.com/users/amueller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amueller/subscriptions","organizations_url":"https://api.github.com/users/amueller/orgs","repos_url":"https://api.github.com/users/amueller/repos","events_url":"https://api.github.com/users/amueller/events{/privacy}","received_events_url":"https://api.github.com/users/amueller/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":119,"state":"closed","created_at":"2015-09-20T02:17:00Z","updated_at":"2016-11-23T09:03:08Z","due_on":"2016-02-29T08:00:00Z","closed_at":"2016-09-29T05:56:17Z"},"comments":3,"created_at":"2016-06-28T20:09:21Z","updated_at":"2017-06-20T19:28:40Z","closed_at":"2016-09-28T04:48:23Z","body":"#### Description\n\nI've been using the `min_weight_fraction_leaf` parameter of DecisionTreeClassifier and RandomForestClassifier incorrectly and I think it's likely other people are doing the same thing as me. \n\nFor example, the documentation for `min_weight_fraction_leaf` in [DecisionTreeClassifier](http://scikit-learn.org/stable/modules/generated/sklearn.tree.DecisionTreeClassifier.html) says\n\n> The minimum weighted fraction of the input samples required to be at a leaf node.\n\nIt was really unclear to me what the docs meant by \"weighted fraction of the input samples\".  Initially I thought it was a weighting based on the size of the classes or the values given by `class_weight`.  I think a slight change in the parameter description could clear up this confusion.  Perhaps something like\n\n> The minimum weighted fraction of the input samples required to be at a leaf node where weights are determined by sample_weight in the fit() method.\n\nFurthermore, it appears `min_weight_fraction_leaf` only applies if `sample_weight` is provided in the call `fit()`.  If `sample_weight` is not provided in the call to `fit()`, `min_weight_fraction_leaf` is silently ignored. Here, I think `min_weight_fraction_leaf` should still apply under the assumption that all samples are equally weighted OR a warning should be given that `min_weight_fraction_leaf` will not be used since `sample_weight` was not provided.\n#### Versions\n\nDarwin-15.5.0-x86_64-i386-64bit\nPython 3.5.1 |Continuum Analytics, Inc.| (default, Dec  7 2015, 11:24:55) \n[GCC 4.2.1 (Apple Inc. build 5577)]\nNumPy 1.11.0\nSciPy 0.17.1\nScikit-Learn 0.17.1\n\nAlso, I would love to make the changes I suggested (if they're deemed worthy), but I have little experience contributing to open-source libraries.  Might need a bit of hand-holding if someone would be willing to help me out.\n"},"comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments/309862980","html_url":"https://github.com/scikit-learn/scikit-learn/issues/6945#issuecomment-309862980","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/6945","id":309862980,"user":{"login":"gg2572","id":12698771,"avatar_url":"https://avatars2.githubusercontent.com/u/12698771?v=3","gravatar_id":"","url":"https://api.github.com/users/gg2572","html_url":"https://github.com/gg2572","followers_url":"https://api.github.com/users/gg2572/followers","following_url":"https://api.github.com/users/gg2572/following{/other_user}","gists_url":"https://api.github.com/users/gg2572/gists{/gist_id}","starred_url":"https://api.github.com/users/gg2572/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gg2572/subscriptions","organizations_url":"https://api.github.com/users/gg2572/orgs","repos_url":"https://api.github.com/users/gg2572/repos","events_url":"https://api.github.com/users/gg2572/events{/privacy}","received_events_url":"https://api.github.com/users/gg2572/received_events","type":"User","site_admin":false},"created_at":"2017-06-20T19:28:40Z","updated_at":"2017-06-20T19:28:40Z","body":"I think this is similar to `min_samples_leaf`. Instead of requiring an absolute number of samples in each leaf node, `min_weight_fraction_leaf` provides the option to require a fraction of samples (or weights) in each leaf. Whether the model is using weights for samples depends on the `class_weight`."}}
{"actor":{"display_login":"gg2572"}}