{"action":"created","comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/52686146","id":52686146,"diff_hunk":"@@ -264,6 +265,105 @@ def randomized_range_finder(A, size, n_iter=2,\n     Q, _ = linalg.qr(safe_sparse_dot(A, Q),  mode='economic')\n     return Q\n \n+def svd_solver(M, n_components, svd_method='auto', n_iter=2, random_state=0,\n+               copy=True):\n+    \"\"\"Unified interface for SVD solvers\n+\n+    Parameters\n+    ----------\n+    M: ndarray or sparse matrix\n+        Matrix to decompose.\n+\n+    n_components: int\n+        Number of singular values and vectors to extract.\n+\n+    svd_method: 'randomized', 'arpack', 'full' or 'auto' (default)\n+        Selects the algorithm for finding singular vectors. If 'randomized',\n+        :func:`sklearn.utils.extmath.randomized_svd` is used, which may be\n+        faster for large matrices on which you wish to extract a small number\n+        of components. If 'arpack', :func:`sklearn.utils.arpack.svds` is used,\n+        which is more accurate, but possibly slower in some cases. If 'full',\n+        :func:`scipy.linalg.svd` is used. Finally, the default 'auto' value\n+        picks 'full' or 'randomized' depending on the dimensions of `M` as well\n+        as `n_components`.\n+\n+    n_iter: int (default is 2)\n+        Number of power iterations (can be used to deal with very noisy\n+        problems).\n+\n+    random_state: RandomState or an int seed (default is 0)\n+        A random number generator instance to make behavior.\n+\n+    copy: bool (default is True)\n+        Copy M or not.\n+\n+    Returns\n+    -------\n+\n+    U:","path":"sklearn/utils/extmath.py","position":47,"original_position":47,"commit_id":"347326677d6205dcc02420365af0d4f116d591c2","original_commit_id":"347326677d6205dcc02420365af0d4f116d591c2","user":{"login":"jakevdp","id":781659,"avatar_url":"https://avatars.githubusercontent.com/u/781659?v=3","gravatar_id":"","url":"https://api.github.com/users/jakevdp","html_url":"https://github.com/jakevdp","followers_url":"https://api.github.com/users/jakevdp/followers","following_url":"https://api.github.com/users/jakevdp/following{/other_user}","gists_url":"https://api.github.com/users/jakevdp/gists{/gist_id}","starred_url":"https://api.github.com/users/jakevdp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakevdp/subscriptions","organizations_url":"https://api.github.com/users/jakevdp/orgs","repos_url":"https://api.github.com/users/jakevdp/repos","events_url":"https://api.github.com/users/jakevdp/events{/privacy}","received_events_url":"https://api.github.com/users/jakevdp/received_events","type":"User","site_admin":false},"body":"U: ndarray","created_at":"2016-02-11T23:39:42Z","updated_at":"2016-02-11T23:39:42Z","html_url":"https://github.com/scikit-learn/scikit-learn/pull/5909#discussion_r52686146","pull_request_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5909","_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/52686146"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/5909#discussion_r52686146"},"pull_request":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5909"}}},"pull_request":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5909","id":51585049,"html_url":"https://github.com/scikit-learn/scikit-learn/pull/5909","diff_url":"https://github.com/scikit-learn/scikit-learn/pull/5909.diff","patch_url":"https://github.com/scikit-learn/scikit-learn/pull/5909.patch","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5909","number":5909,"state":"open","locked":false,"title":"ENH: interface for SVD solvers","user":{"login":"mfrodl","id":12383572,"avatar_url":"https://avatars.githubusercontent.com/u/12383572?v=3","gravatar_id":"","url":"https://api.github.com/users/mfrodl","html_url":"https://github.com/mfrodl","followers_url":"https://api.github.com/users/mfrodl/followers","following_url":"https://api.github.com/users/mfrodl/following{/other_user}","gists_url":"https://api.github.com/users/mfrodl/gists{/gist_id}","starred_url":"https://api.github.com/users/mfrodl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfrodl/subscriptions","organizations_url":"https://api.github.com/users/mfrodl/orgs","repos_url":"https://api.github.com/users/mfrodl/repos","events_url":"https://api.github.com/users/mfrodl/events{/privacy}","received_events_url":"https://api.github.com/users/mfrodl/received_events","type":"User","site_admin":false},"body":"This pull request addresses issue #5585.\r\n\r\nI realise the function should have a proper documentation as well as some tests. I will add these as soon as / if the code is positively received. Please review.","created_at":"2015-11-23T21:46:52Z","updated_at":"2016-02-11T23:39:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"56801e54313985f1ffd3380d4d72f50b65b978c4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5909/commits","review_comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5909/comments","review_comment_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5909/comments","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/347326677d6205dcc02420365af0d4f116d591c2","head":{"label":"mfrodl:master","ref":"master","sha":"347326677d6205dcc02420365af0d4f116d591c2","user":{"login":"mfrodl","id":12383572,"avatar_url":"https://avatars.githubusercontent.com/u/12383572?v=3","gravatar_id":"","url":"https://api.github.com/users/mfrodl","html_url":"https://github.com/mfrodl","followers_url":"https://api.github.com/users/mfrodl/followers","following_url":"https://api.github.com/users/mfrodl/following{/other_user}","gists_url":"https://api.github.com/users/mfrodl/gists{/gist_id}","starred_url":"https://api.github.com/users/mfrodl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfrodl/subscriptions","organizations_url":"https://api.github.com/users/mfrodl/orgs","repos_url":"https://api.github.com/users/mfrodl/repos","events_url":"https://api.github.com/users/mfrodl/events{/privacy}","received_events_url":"https://api.github.com/users/mfrodl/received_events","type":"User","site_admin":false},"repo":{"id":44744517,"name":"scikit-learn","full_name":"mfrodl/scikit-learn","owner":{"login":"mfrodl","id":12383572,"avatar_url":"https://avatars.githubusercontent.com/u/12383572?v=3","gravatar_id":"","url":"https://api.github.com/users/mfrodl","html_url":"https://github.com/mfrodl","followers_url":"https://api.github.com/users/mfrodl/followers","following_url":"https://api.github.com/users/mfrodl/following{/other_user}","gists_url":"https://api.github.com/users/mfrodl/gists{/gist_id}","starred_url":"https://api.github.com/users/mfrodl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfrodl/subscriptions","organizations_url":"https://api.github.com/users/mfrodl/orgs","repos_url":"https://api.github.com/users/mfrodl/repos","events_url":"https://api.github.com/users/mfrodl/events{/privacy}","received_events_url":"https://api.github.com/users/mfrodl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mfrodl/scikit-learn","description":"scikit-learn: machine learning in Python","fork":true,"url":"https://api.github.com/repos/mfrodl/scikit-learn","forks_url":"https://api.github.com/repos/mfrodl/scikit-learn/forks","keys_url":"https://api.github.com/repos/mfrodl/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mfrodl/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mfrodl/scikit-learn/teams","hooks_url":"https://api.github.com/repos/mfrodl/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/mfrodl/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/mfrodl/scikit-learn/events","assignees_url":"https://api.github.com/repos/mfrodl/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/mfrodl/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/mfrodl/scikit-learn/tags","blobs_url":"https://api.github.com/repos/mfrodl/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mfrodl/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mfrodl/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/mfrodl/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mfrodl/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/mfrodl/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/mfrodl/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/mfrodl/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/mfrodl/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/mfrodl/scikit-learn/subscription","commits_url":"https://api.github.com/repos/mfrodl/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/mfrodl/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/mfrodl/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/mfrodl/scikit-learn/issues/comments{/number}","contents_url":"https://api.github.com/repos/mfrodl/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/mfrodl/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mfrodl/scikit-learn/merges","archive_url":"https://api.github.com/repos/mfrodl/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mfrodl/scikit-learn/downloads","issues_url":"https://api.github.com/repos/mfrodl/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/mfrodl/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/mfrodl/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/mfrodl/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mfrodl/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/mfrodl/scikit-learn/releases{/id}","deployments_url":"https://api.github.com/repos/mfrodl/scikit-learn/deployments","created_at":"2015-10-22T12:45:47Z","updated_at":"2016-01-25T21:37:15Z","pushed_at":"2016-01-26T20:55:08Z","git_url":"git://github.com/mfrodl/scikit-learn.git","ssh_url":"git@github.com:mfrodl/scikit-learn.git","clone_url":"https://github.com/mfrodl/scikit-learn.git","svn_url":"https://github.com/mfrodl/scikit-learn","homepage":"http://scikit-learn.org","size":69980,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scikit-learn:master","ref":"master","sha":"30e83cfbcef3115d6bc24ed727f064c14ddc4ea1","user":{"login":"scikit-learn","id":365630,"avatar_url":"https://avatars.githubusercontent.com/u/365630?v=3","gravatar_id":"","url":"https://api.github.com/users/scikit-learn","html_url":"https://github.com/scikit-learn","followers_url":"https://api.github.com/users/scikit-learn/followers","following_url":"https://api.github.com/users/scikit-learn/following{/other_user}","gists_url":"https://api.github.com/users/scikit-learn/gists{/gist_id}","starred_url":"https://api.github.com/users/scikit-learn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scikit-learn/subscriptions","organizations_url":"https://api.github.com/users/scikit-learn/orgs","repos_url":"https://api.github.com/users/scikit-learn/repos","events_url":"https://api.github.com/users/scikit-learn/events{/privacy}","received_events_url":"https://api.github.com/users/scikit-learn/received_events","type":"Organization","site_admin":false},"repo":{"id":843222,"name":"scikit-learn","full_name":"scikit-learn/scikit-learn","owner":{"login":"scikit-learn","id":365630,"avatar_url":"https://avatars.githubusercontent.com/u/365630?v=3","gravatar_id":"","url":"https://api.github.com/users/scikit-learn","html_url":"https://github.com/scikit-learn","followers_url":"https://api.github.com/users/scikit-learn/followers","following_url":"https://api.github.com/users/scikit-learn/following{/other_user}","gists_url":"https://api.github.com/users/scikit-learn/gists{/gist_id}","starred_url":"https://api.github.com/users/scikit-learn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scikit-learn/subscriptions","organizations_url":"https://api.github.com/users/scikit-learn/orgs","repos_url":"https://api.github.com/users/scikit-learn/repos","events_url":"https://api.github.com/users/scikit-learn/events{/privacy}","received_events_url":"https://api.github.com/users/scikit-learn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scikit-learn/scikit-learn","description":"scikit-learn: machine learning in Python","fork":false,"url":"https://api.github.com/repos/scikit-learn/scikit-learn","forks_url":"https://api.github.com/repos/scikit-learn/scikit-learn/forks","keys_url":"https://api.github.com/repos/scikit-learn/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scikit-learn/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scikit-learn/scikit-learn/teams","hooks_url":"https://api.github.com/repos/scikit-learn/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/events","assignees_url":"https://api.github.com/repos/scikit-learn/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/scikit-learn/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/scikit-learn/scikit-learn/tags","blobs_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/scikit-learn/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/scikit-learn/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/scikit-learn/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/scikit-learn/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/scikit-learn/scikit-learn/subscription","commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments{/number}","contents_url":"https://api.github.com/repos/scikit-learn/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/scikit-learn/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scikit-learn/scikit-learn/merges","archive_url":"https://api.github.com/repos/scikit-learn/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scikit-learn/scikit-learn/downloads","issues_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/scikit-learn/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/scikit-learn/scikit-learn/releases{/id}","deployments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/deployments","created_at":"2010-08-17T09:43:38Z","updated_at":"2016-02-11T20:48:14Z","pushed_at":"2016-02-11T22:50:48Z","git_url":"git://github.com/scikit-learn/scikit-learn.git","ssh_url":"git@github.com:scikit-learn/scikit-learn.git","clone_url":"https://github.com/scikit-learn/scikit-learn.git","svn_url":"https://github.com/scikit-learn/scikit-learn","homepage":"http://scikit-learn.org","size":100234,"stargazers_count":9720,"watchers_count":9720,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5702,"mirror_url":null,"open_issues_count":1040,"forks":5702,"open_issues":1040,"watchers":9720,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5909"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/5909"},"issue":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5909"},"comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5909/comments"},"review_comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5909/comments"},"review_comment":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/5909/commits"},"statuses":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/347326677d6205dcc02420365af0d4f116d591c2"}}}}