{"action":"created","issue":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/8065","repository_url":"https://api.github.com/repos/scikit-learn/scikit-learn","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/8065/labels{/name}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/8065/comments","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/8065/events","html_url":"https://github.com/scikit-learn/scikit-learn/pull/8065","id":195954341,"number":8065,"title":"[MRG + 2] Allow f_regression to accept a sparse matrix with centering","user":{"login":"acadiansith","id":10876009,"avatar_url":"https://avatars.githubusercontent.com/u/10876009?v=3","gravatar_id":"","url":"https://api.github.com/users/acadiansith","html_url":"https://github.com/acadiansith","followers_url":"https://api.github.com/users/acadiansith/followers","following_url":"https://api.github.com/users/acadiansith/following{/other_user}","gists_url":"https://api.github.com/users/acadiansith/gists{/gist_id}","starred_url":"https://api.github.com/users/acadiansith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acadiansith/subscriptions","organizations_url":"https://api.github.com/users/acadiansith/orgs","repos_url":"https://api.github.com/users/acadiansith/repos","events_url":"https://api.github.com/users/acadiansith/events{/privacy}","received_events_url":"https://api.github.com/users/acadiansith/received_events","type":"User","site_admin":false},"labels":[{"id":297514516,"url":"https://api.github.com/repos/scikit-learn/scikit-learn/labels/Needs%20Review","name":"Needs Review","color":"f7c6c7","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-16T00:42:15Z","updated_at":"2016-12-20T13:23:43Z","closed_at":"2016-12-20T13:23:33Z","pull_request":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/8065","html_url":"https://github.com/scikit-learn/scikit-learn/pull/8065","diff_url":"https://github.com/scikit-learn/scikit-learn/pull/8065.diff","patch_url":"https://github.com/scikit-learn/scikit-learn/pull/8065.patch"},"body":"<!--\r\nThanks for contributing a pull request! Please ensure you have taken a look at\r\nthe contribution guidelines: https://github.com/scikit-learn/scikit-learn/blob/master/CONTRIBUTING.md#Contributing-Pull-Requests\r\n-->\r\n#### Reference Issue\r\n<!-- Example: Fixes #1234 -->\r\nN/A\r\n\r\n#### What does this implement/fix? Explain your changes.\r\n`f_regression` currently doesn't accept sparse matrices when `center=True` to avoid allocating a dense matrix of the centered `X` values, but the computation can be completed without this dense matrix. The numerators can take advantage of the observation that `E[(X - E[X])(Y - E[Y])] = E[X(Y - E[Y])]`, and the denominator can use `E[(X - E[X])^2] = E[X^2] - E[X]^2`. \r\n\r\nI've also included a unit test to verify that the output is the same for sparse and dense versions of a matrix.\r\n\r\n#### Any other comments?\r\nThe output is the same as before (I've checked by hand), but I don't have any tests included to confirm this.\r\n\r\n<!--\r\nPlease be aware that we are a loose team of volunteers so patience is\r\nnecessary; assistance handling other issues is very welcome. We value\r\nall user contributions, no matter how minor they are. If we are slow to\r\nreview, either the pull request needs some benchmarking, tinkering,\r\nconvincing, etc. or more likely the reviewers are simply busy. In either\r\ncase, we ask for your understanding during the review process.\r\nFor more information, see our FAQ on this topic:\r\nhttp://scikit-learn.org/dev/faq.html#why-is-my-pull-request-not-getting-any-attention.\r\n\r\nThanks for contributing!\r\n-->"},"comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments/268241784","html_url":"https://github.com/scikit-learn/scikit-learn/pull/8065#issuecomment-268241784","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/8065","id":268241784,"user":{"login":"TomDLT","id":11065596,"avatar_url":"https://avatars.githubusercontent.com/u/11065596?v=3","gravatar_id":"","url":"https://api.github.com/users/TomDLT","html_url":"https://github.com/TomDLT","followers_url":"https://api.github.com/users/TomDLT/followers","following_url":"https://api.github.com/users/TomDLT/following{/other_user}","gists_url":"https://api.github.com/users/TomDLT/gists{/gist_id}","starred_url":"https://api.github.com/users/TomDLT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomDLT/subscriptions","organizations_url":"https://api.github.com/users/TomDLT/orgs","repos_url":"https://api.github.com/users/TomDLT/repos","events_url":"https://api.github.com/users/TomDLT/events{/privacy}","received_events_url":"https://api.github.com/users/TomDLT/received_events","type":"User","site_admin":false},"created_at":"2016-12-20T13:23:43Z","updated_at":"2016-12-20T13:23:43Z","body":"Thanks @acadiansith "}}
{"actor":{"display_login":"TomDLT"}}