{"action":"created","issue":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/6846","repository_url":"https://api.github.com/repos/scikit-learn/scikit-learn","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/6846/labels{/name}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/6846/comments","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/6846/events","html_url":"https://github.com/scikit-learn/scikit-learn/pull/6846","id":157685383,"number":6846,"title":"[MRG+1] Allows KMeans/MiniBatchKMeans to use float32 internally by using cython fused types","user":{"login":"yenchenlin","id":7057863,"avatar_url":"https://avatars.githubusercontent.com/u/7057863?v=3","gravatar_id":"","url":"https://api.github.com/users/yenchenlin","html_url":"https://github.com/yenchenlin","followers_url":"https://api.github.com/users/yenchenlin/followers","following_url":"https://api.github.com/users/yenchenlin/following{/other_user}","gists_url":"https://api.github.com/users/yenchenlin/gists{/gist_id}","starred_url":"https://api.github.com/users/yenchenlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yenchenlin/subscriptions","organizations_url":"https://api.github.com/users/yenchenlin/orgs","repos_url":"https://api.github.com/users/yenchenlin/repos","events_url":"https://api.github.com/users/yenchenlin/events{/privacy}","received_events_url":"https://api.github.com/users/yenchenlin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones/18","html_url":"https://github.com/scikit-learn/scikit-learn/milestones/0.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://avatars.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":37,"closed_issues":10,"state":"open","created_at":"2015-09-20T02:17:00Z","updated_at":"2016-06-04T16:46:27Z","due_on":"2016-02-29T08:00:00Z","closed_at":null},"comments":22,"created_at":"2016-05-31T14:27:27Z","updated_at":"2016-06-18T06:29:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/6846","html_url":"https://github.com/scikit-learn/scikit-learn/pull/6846","diff_url":"https://github.com/scikit-learn/scikit-learn/pull/6846.diff","patch_url":"https://github.com/scikit-learn/scikit-learn/pull/6846.patch"},"body":"This is a follow-up PR for #6430, which use fused types in Cython to work with `np.float32` inputs without wasting memory by converting them internally to `np.float64`.\r\n\r\nSince [Sparse Func Utils now supports Cython fused types](http://yclin.me/2016/05/sparse-func-utils), we can avoid zig-zag memory usage which showed in #6430 .\r\n\r\nBefore this PR:\r\n\r\n![master](https://cloud.githubusercontent.com/assets/7057863/15679091/35748228-2783-11e6-98ae-596b460c2d1a.png)\r\n\r\nAfter this PR:\r\n\r\n![fused_types](https://cloud.githubusercontent.com/assets/7057863/15679092/374d2794-2783-11e6-8b95-7aac1347581c.png)\r\n\r\nHere is the test script used to generate above figures (thanks @ssaeger):\r\n```python\r\nimport numpy as np\r\nfrom sklearn.cluster import KMeans\r\n\r\n@profile\r\ndef fit_est():\r\n    estimator.fit(X)\r\n\r\nnp.random.seed(5)\r\nX = np.random.rand(200000, 20)\r\nX = np.float32(X)\r\n\r\nestimator = KMeans()\r\nfit_est()\r\n\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments/226925232","html_url":"https://github.com/scikit-learn/scikit-learn/pull/6846#issuecomment-226925232","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/6846","id":226925232,"user":{"login":"yenchenlin","id":7057863,"avatar_url":"https://avatars.githubusercontent.com/u/7057863?v=3","gravatar_id":"","url":"https://api.github.com/users/yenchenlin","html_url":"https://github.com/yenchenlin","followers_url":"https://api.github.com/users/yenchenlin/followers","following_url":"https://api.github.com/users/yenchenlin/following{/other_user}","gists_url":"https://api.github.com/users/yenchenlin/gists{/gist_id}","starred_url":"https://api.github.com/users/yenchenlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yenchenlin/subscriptions","organizations_url":"https://api.github.com/users/yenchenlin/orgs","repos_url":"https://api.github.com/users/yenchenlin/repos","events_url":"https://api.github.com/users/yenchenlin/events{/privacy}","received_events_url":"https://api.github.com/users/yenchenlin/received_events","type":"User","site_admin":false},"created_at":"2016-06-18T06:29:39Z","updated_at":"2016-06-18T06:29:39Z","body":"Thanks @MechCoder for the inputs, please have a look when you have time!"}}
{"actor":{"display_login":"yenchenlin"}}