{"action":"created","issue":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5278","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5278/labels{/name}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5278/comments","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5278/events","html_url":"https://github.com/scikit-learn/scikit-learn/pull/5278","id":106745565,"number":5278,"title":"[MRG] _criterion.pyx cleanup","user":{"login":"jmschrei","id":3916816,"avatar_url":"https://avatars.githubusercontent.com/u/3916816?v=3","gravatar_id":"","url":"https://api.github.com/users/jmschrei","html_url":"https://github.com/jmschrei","followers_url":"https://api.github.com/users/jmschrei/followers","following_url":"https://api.github.com/users/jmschrei/following{/other_user}","gists_url":"https://api.github.com/users/jmschrei/gists{/gist_id}","starred_url":"https://api.github.com/users/jmschrei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmschrei/subscriptions","organizations_url":"https://api.github.com/users/jmschrei/orgs","repos_url":"https://api.github.com/users/jmschrei/repos","events_url":"https://api.github.com/users/jmschrei/events{/privacy}","received_events_url":"https://api.github.com/users/jmschrei/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-09-16T10:33:39Z","updated_at":"2015-09-16T12:16:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5278","html_url":"https://github.com/scikit-learn/scikit-learn/pull/5278","diff_url":"https://github.com/scikit-learn/scikit-learn/pull/5278.diff","patch_url":"https://github.com/scikit-learn/scikit-learn/pull/5278.patch"},"body":"This pull request focuses on cleaning up criterion code, without adding any new functionality. This is the first step to adding caching between splits. That branch had too many changes, so I broke it up to be easier to review. This PR addresses the following:\r\n\r\n(1) Eliminates nearly 200 lines of unneeded code (mostly by calling class variables `self.n_outputs` directly instead of unpacking them)\r\n(2) Standardizes `label_count` for classification criteria and `sum_total` for regression into the `node_sum` (repeat for left and right versions)\r\n(3) Adds `yw_sq_sum` as the last sufficient statistic needed for regression criteria between splits\r\n(4) Previously, regression `child_impurity` recalculated sufficient statistics by rescanning the sequence, despite them already being present. I fixed this. However, the speed increase is minimal given how rarely this function is called.\r\n\r\nAll unit tests pass, and speed is basically the same as before.  \r\n\r\nping @arjoly @glouppe @ogrisel "},"comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments/140724580","html_url":"https://github.com/scikit-learn/scikit-learn/pull/5278#issuecomment-140724580","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5278","id":140724580,"user":{"login":"jmschrei","id":3916816,"avatar_url":"https://avatars.githubusercontent.com/u/3916816?v=3","gravatar_id":"","url":"https://api.github.com/users/jmschrei","html_url":"https://github.com/jmschrei","followers_url":"https://api.github.com/users/jmschrei/followers","following_url":"https://api.github.com/users/jmschrei/following{/other_user}","gists_url":"https://api.github.com/users/jmschrei/gists{/gist_id}","starred_url":"https://api.github.com/users/jmschrei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmschrei/subscriptions","organizations_url":"https://api.github.com/users/jmschrei/orgs","repos_url":"https://api.github.com/users/jmschrei/repos","events_url":"https://api.github.com/users/jmschrei/events{/privacy}","received_events_url":"https://api.github.com/users/jmschrei/received_events","type":"User","site_admin":false},"created_at":"2015-09-16T12:16:53Z","updated_at":"2015-09-16T12:16:53Z","body":"I am working towards caching w_y and w_sq_y between splits. However, it was too much for a single pull request, so I broke it into two for easier review. This is the first PR. I will be submitting the second PR soon, after this one is merged. "}}