{"action":"created","issue":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/7645","repository_url":"https://api.github.com/repos/scikit-learn/scikit-learn","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/7645/labels{/name}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/7645/comments","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/7645/events","html_url":"https://github.com/scikit-learn/scikit-learn/issues/7645","id":182368542,"number":7645,"title":"HashingVectorizer slow in version 0.18 on Windows","user":{"login":"gabit","id":388496,"avatar_url":"https://avatars.githubusercontent.com/u/388496?v=3","gravatar_id":"","url":"https://api.github.com/users/gabit","html_url":"https://github.com/gabit","followers_url":"https://api.github.com/users/gabit/followers","following_url":"https://api.github.com/users/gabit/following{/other_user}","gists_url":"https://api.github.com/users/gabit/gists{/gist_id}","starred_url":"https://api.github.com/users/gabit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabit/subscriptions","organizations_url":"https://api.github.com/users/gabit/orgs","repos_url":"https://api.github.com/users/gabit/repos","events_url":"https://api.github.com/users/gabit/events{/privacy}","received_events_url":"https://api.github.com/users/gabit/received_events","type":"User","site_admin":false},"labels":[{"id":273400470,"url":"https://api.github.com/repos/scikit-learn/scikit-learn/labels/Blocker","name":"Blocker","color":"e11d21","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones/22","html_url":"https://github.com/scikit-learn/scikit-learn/milestones/0.18.1","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones/22/labels","id":2046567,"number":22,"title":"0.18.1","description":"Urgent fixes to bugs and web site issues.","creator":{"login":"jnothman","id":78827,"avatar_url":"https://avatars.githubusercontent.com/u/78827?v=3","gravatar_id":"","url":"https://api.github.com/users/jnothman","html_url":"https://github.com/jnothman","followers_url":"https://api.github.com/users/jnothman/followers","following_url":"https://api.github.com/users/jnothman/following{/other_user}","gists_url":"https://api.github.com/users/jnothman/gists{/gist_id}","starred_url":"https://api.github.com/users/jnothman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnothman/subscriptions","organizations_url":"https://api.github.com/users/jnothman/orgs","repos_url":"https://api.github.com/users/jnothman/repos","events_url":"https://api.github.com/users/jnothman/events{/privacy}","received_events_url":"https://api.github.com/users/jnothman/received_events","type":"User","site_admin":false},"open_issues":27,"closed_issues":36,"state":"open","created_at":"2016-10-04T11:55:58Z","updated_at":"2016-10-27T22:23:52Z","due_on":null,"closed_at":null},"comments":19,"created_at":"2016-10-11T20:40:44Z","updated_at":"2016-10-28T06:55:50Z","closed_at":null,"body":"<!--\r\nIf your issue is a usage question, submit it here instead:\r\n- StackOverflow with the scikit-learn tag: http://stackoverflow.com/questions/tagged/scikit-learn\r\n- Mailing List: https://mail.python.org/mailman/listinfo/scikit-learn\r\nFor more information, see User Questions: http://scikit-learn.org/stable/support.html#user-questions\r\n-->\r\n\r\n<!-- Instructions For Filing a Bug: https://github.com/scikit-learn/scikit-learn/blob/master/CONTRIBUTING.md#filing-bugs -->\r\n\r\n#### Description\r\nAfter upgrading to scikit-learn 0.18 HashingVectorizer is about 10 times slower.\r\n\r\nBefore:\r\n```\r\nscikit-learn 0.17. Numpy 1.11.2. Python 3.5.2 AMD64\r\nVectorizing 20newsgroup 11314 documents\r\nVectorization completed in  4.594092130661011  seconds, resulting shape  (11314, 1048576)\r\n```\r\n\r\nAfter upgrade:\r\n```\r\nscikit-learn 0.18. Numpy 1.11.2. Python 3.5.2 AMD64\r\nVectorizing 20newsgroup 11314 documents\r\nVectorization completed in  43.587692737579346  seconds, resulting shape  (11314, 1048576)\r\n```\r\n\r\n#### Steps/Code to Reproduce\r\n\r\n```py\r\nimport time, sklearn, platform, numpy\r\nfrom sklearn.datasets import fetch_20newsgroups\r\nfrom sklearn.feature_extraction.text import HashingVectorizer\r\n\r\ndata_train = fetch_20newsgroups(subset='train', shuffle=True, random_state=42)\r\n\r\nprint('scikit-learn {}. Numpy {}. Python {} {}'.format(\r\n    sklearn.__version__, numpy.version.full_version,\r\n    platform.python_version(), platform.machine()))\r\n\r\nvectorizer = HashingVectorizer()\r\nprint(\"Vectorizing 20newsgroup {} documents\".format(len(data_train.data)))\r\nstart = time.time()\r\ndata = vectorizer.fit_transform(data_train.data)\r\nprint(\"Vectorization completed in \", time.time() - start,\r\n    ' seconds, resulting shape ', data.shape)\r\n```\r\n\r\n#### Expected Results\r\nvectorization should take about 5 seconds, as in version 0.17\r\n\r\n#### Actual Results\r\nvectorization takes 42 seconds in version 0.18\r\n\r\n#### Versions\r\nscikit-learn 0.18. Numpy 1.11.2. Python 3.5.2 AMD64\r\n\r\n\r\n<!-- Thanks for contributing! -->\r\n"},"comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments/256849972","html_url":"https://github.com/scikit-learn/scikit-learn/issues/7645#issuecomment-256849972","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/7645","id":256849972,"user":{"login":"lesteve","id":1680079,"avatar_url":"https://avatars.githubusercontent.com/u/1680079?v=3","gravatar_id":"","url":"https://api.github.com/users/lesteve","html_url":"https://github.com/lesteve","followers_url":"https://api.github.com/users/lesteve/followers","following_url":"https://api.github.com/users/lesteve/following{/other_user}","gists_url":"https://api.github.com/users/lesteve/gists{/gist_id}","starred_url":"https://api.github.com/users/lesteve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lesteve/subscriptions","organizations_url":"https://api.github.com/users/lesteve/orgs","repos_url":"https://api.github.com/users/lesteve/repos","events_url":"https://api.github.com/users/lesteve/events{/privacy}","received_events_url":"https://api.github.com/users/lesteve/received_events","type":"User","site_admin":false},"created_at":"2016-10-28T06:55:50Z","updated_at":"2016-10-28T06:55:50Z","body":"I think we should leave this one open just to remember to build with the latest cython on Windows for 0.18.1."}}
{"actor":{"display_login":"lesteve"}}