{"action":"created","comment":{"url":"https://api.github.com/repos/mlpack/mlpack/pulls/comments/69568849","id":69568849,"diff_hunk":"@@ -57,26 +95,23 @@ int main(int argc, char** argv)\n \n   // Get the options for running PCA.\n   const size_t scale = CLI::HasParam(\"scale\");\n+  const double varToRetain = CLI::GetParam<double>(\"var_to_retain\");\n+  const string decompositionMethod = CLI::GetParam<string>(\n+      \"decomposition_method\");\n \n   // Perform PCA.\n-  PCA p(scale);\n-  Log::Info << \"Performing PCA on dataset...\" << endl;\n-  double varRetained;\n-  if (CLI::GetParam<double>(\"var_to_retain\") != 0)\n+  if (decompositionMethod == \"exact\")\n   {\n-    if (CLI::GetParam<int>(\"new_dimensionality\") != 0)\n-      Log::Warn << \"New dimensionality (-d) ignored because --var_to_retain was\"\n-          << \" specified.\" << endl;\n-\n-    varRetained = p.Apply(dataset, CLI::GetParam<double>(\"var_to_retain\"));\n+    RunPCA<ExactSVDPolicy>(dataset, newDimension, scale, varToRetain);\n   }\n-  else\n+  else if(decompositionMethod == \"randomized\")\n   {\n-    varRetained = p.Apply(dataset, newDimension);\n+    RunPCA<RandomizedSVDPolicy>(dataset, newDimension, scale, varToRetain);\n+  }\n+  else if(decompositionMethod == \"quic\")\n+  {\n+    RunPCA<QUICSVDPolicy>(dataset, newDimension, scale, varToRetain);\n   }","path":"src/mlpack/methods/pca/pca_main.cpp","position":102,"original_position":104,"commit_id":"1127e61b078faff9baefeeea5b9f75c925f8aed1","original_commit_id":"1d675d4febd84d3210a10c6cc18efa1bb1558045","user":{"login":"zoq","id":4209744,"avatar_url":"https://avatars.githubusercontent.com/u/4209744?v=3","gravatar_id":"","url":"https://api.github.com/users/zoq","html_url":"https://github.com/zoq","followers_url":"https://api.github.com/users/zoq/followers","following_url":"https://api.github.com/users/zoq/following{/other_user}","gists_url":"https://api.github.com/users/zoq/gists{/gist_id}","starred_url":"https://api.github.com/users/zoq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zoq/subscriptions","organizations_url":"https://api.github.com/users/zoq/orgs","repos_url":"https://api.github.com/users/zoq/repos","events_url":"https://api.github.com/users/zoq/events{/privacy}","received_events_url":"https://api.github.com/users/zoq/received_events","type":"User","site_admin":false},"body":"Ah, right, changed in 1127e61.","created_at":"2016-07-05T14:08:26Z","updated_at":"2016-07-05T14:08:26Z","html_url":"https://github.com/mlpack/mlpack/pull/716#discussion_r69568849","pull_request_url":"https://api.github.com/repos/mlpack/mlpack/pulls/716","_links":{"self":{"href":"https://api.github.com/repos/mlpack/mlpack/pulls/comments/69568849"},"html":{"href":"https://github.com/mlpack/mlpack/pull/716#discussion_r69568849"},"pull_request":{"href":"https://api.github.com/repos/mlpack/mlpack/pulls/716"}}},"pull_request":{"url":"https://api.github.com/repos/mlpack/mlpack/pulls/716","id":76156190,"html_url":"https://github.com/mlpack/mlpack/pull/716","diff_url":"https://github.com/mlpack/mlpack/pull/716.diff","patch_url":"https://github.com/mlpack/mlpack/pull/716.patch","issue_url":"https://api.github.com/repos/mlpack/mlpack/issues/716","number":716,"state":"open","locked":false,"title":"Refactor PCA class: able to use different decomposition techniques (exact, randomized, QUIC SVD).","user":{"login":"zoq","id":4209744,"avatar_url":"https://avatars.githubusercontent.com/u/4209744?v=3","gravatar_id":"","url":"https://api.github.com/users/zoq","html_url":"https://github.com/zoq","followers_url":"https://api.github.com/users/zoq/followers","following_url":"https://api.github.com/users/zoq/following{/other_user}","gists_url":"https://api.github.com/users/zoq/gists{/gist_id}","starred_url":"https://api.github.com/users/zoq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zoq/subscriptions","organizations_url":"https://api.github.com/users/zoq/orgs","repos_url":"https://api.github.com/users/zoq/repos","events_url":"https://api.github.com/users/zoq/events{/privacy}","received_events_url":"https://api.github.com/users/zoq/received_events","type":"User","site_admin":false},"body":"As Nilay pointed out in his blog post: http://mlpack.org/gsocblog/we-need-to-go-deeper-googlenet-week-5-highlights.html\r\n\r\nthe discretize function that uses the PCA class, wasn't what we expected runtime wise, so we decided to use the another PCA approach: Randomized SVD as proposed in:\r\n\r\n```\r\n* @article{Halko2011,\r\n*   author  = {Halko, N. and Martinsson, P. G. and Tropp, J. A.},\r\n*   title   = {Finding Structure with Randomness: Probabilistic Algorithms for\r\n                Constructing Approximate Matrix Decompositions},\r\n*   journal = {SIAM Rev.},\r\n*   volume  = {53},\r\n*   year    = {2011},\r\n* }\r\n*\r\n* @article{Szlam2014,\r\n*   author  = {Arthur Szlam Yuval Kluger and Mark Tygert},\r\n*   title   = {An implementation of a randomized algorithm for principal\r\n            component analysis},\r\n*   journal = {CoRR},\r\n*   volume  = {abs/1412.3510},\r\n*   year    = {2014},\r\n* }\r\n```\r\nI refactored the PCA class, that is now able to use different decomposition methods including the already existing QUIC-SVD technique.\r\n","created_at":"2016-07-04T12:25:09Z","updated_at":"2016-07-05T14:08:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9638fac4078cd27dfa1b82f8a55b3e3bf28689ea","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mlpack/mlpack/pulls/716/commits","review_comments_url":"https://api.github.com/repos/mlpack/mlpack/pulls/716/comments","review_comment_url":"https://api.github.com/repos/mlpack/mlpack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mlpack/mlpack/issues/716/comments","statuses_url":"https://api.github.com/repos/mlpack/mlpack/statuses/1127e61b078faff9baefeeea5b9f75c925f8aed1","head":{"label":"zoq:randomized_pca","ref":"randomized_pca","sha":"1127e61b078faff9baefeeea5b9f75c925f8aed1","user":{"login":"zoq","id":4209744,"avatar_url":"https://avatars.githubusercontent.com/u/4209744?v=3","gravatar_id":"","url":"https://api.github.com/users/zoq","html_url":"https://github.com/zoq","followers_url":"https://api.github.com/users/zoq/followers","following_url":"https://api.github.com/users/zoq/following{/other_user}","gists_url":"https://api.github.com/users/zoq/gists{/gist_id}","starred_url":"https://api.github.com/users/zoq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zoq/subscriptions","organizations_url":"https://api.github.com/users/zoq/orgs","repos_url":"https://api.github.com/users/zoq/repos","events_url":"https://api.github.com/users/zoq/events{/privacy}","received_events_url":"https://api.github.com/users/zoq/received_events","type":"User","site_admin":false},"repo":{"id":60289026,"name":"mlpack","full_name":"zoq/mlpack","owner":{"login":"zoq","id":4209744,"avatar_url":"https://avatars.githubusercontent.com/u/4209744?v=3","gravatar_id":"","url":"https://api.github.com/users/zoq","html_url":"https://github.com/zoq","followers_url":"https://api.github.com/users/zoq/followers","following_url":"https://api.github.com/users/zoq/following{/other_user}","gists_url":"https://api.github.com/users/zoq/gists{/gist_id}","starred_url":"https://api.github.com/users/zoq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zoq/subscriptions","organizations_url":"https://api.github.com/users/zoq/orgs","repos_url":"https://api.github.com/users/zoq/repos","events_url":"https://api.github.com/users/zoq/events{/privacy}","received_events_url":"https://api.github.com/users/zoq/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zoq/mlpack","description":"mlpack: a scalable C++ machine learning library","fork":true,"url":"https://api.github.com/repos/zoq/mlpack","forks_url":"https://api.github.com/repos/zoq/mlpack/forks","keys_url":"https://api.github.com/repos/zoq/mlpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zoq/mlpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zoq/mlpack/teams","hooks_url":"https://api.github.com/repos/zoq/mlpack/hooks","issue_events_url":"https://api.github.com/repos/zoq/mlpack/issues/events{/number}","events_url":"https://api.github.com/repos/zoq/mlpack/events","assignees_url":"https://api.github.com/repos/zoq/mlpack/assignees{/user}","branches_url":"https://api.github.com/repos/zoq/mlpack/branches{/branch}","tags_url":"https://api.github.com/repos/zoq/mlpack/tags","blobs_url":"https://api.github.com/repos/zoq/mlpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zoq/mlpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zoq/mlpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/zoq/mlpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zoq/mlpack/statuses/{sha}","languages_url":"https://api.github.com/repos/zoq/mlpack/languages","stargazers_url":"https://api.github.com/repos/zoq/mlpack/stargazers","contributors_url":"https://api.github.com/repos/zoq/mlpack/contributors","subscribers_url":"https://api.github.com/repos/zoq/mlpack/subscribers","subscription_url":"https://api.github.com/repos/zoq/mlpack/subscription","commits_url":"https://api.github.com/repos/zoq/mlpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/zoq/mlpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/zoq/mlpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/zoq/mlpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/zoq/mlpack/contents/{+path}","compare_url":"https://api.github.com/repos/zoq/mlpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zoq/mlpack/merges","archive_url":"https://api.github.com/repos/zoq/mlpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zoq/mlpack/downloads","issues_url":"https://api.github.com/repos/zoq/mlpack/issues{/number}","pulls_url":"https://api.github.com/repos/zoq/mlpack/pulls{/number}","milestones_url":"https://api.github.com/repos/zoq/mlpack/milestones{/number}","notifications_url":"https://api.github.com/repos/zoq/mlpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zoq/mlpack/labels{/name}","releases_url":"https://api.github.com/repos/zoq/mlpack/releases{/id}","deployments_url":"https://api.github.com/repos/zoq/mlpack/deployments","created_at":"2016-06-02T18:47:05Z","updated_at":"2016-06-02T18:47:09Z","pushed_at":"2016-07-05T14:01:45Z","git_url":"git://github.com/zoq/mlpack.git","ssh_url":"git@github.com:zoq/mlpack.git","clone_url":"https://github.com/zoq/mlpack.git","svn_url":"https://github.com/zoq/mlpack","homepage":null,"size":146184,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"mlpack:master","ref":"master","sha":"3c801d6c8d5aa40e79858d2389ad2e7c02a8ca88","user":{"login":"mlpack","id":10216045,"avatar_url":"https://avatars.githubusercontent.com/u/10216045?v=3","gravatar_id":"","url":"https://api.github.com/users/mlpack","html_url":"https://github.com/mlpack","followers_url":"https://api.github.com/users/mlpack/followers","following_url":"https://api.github.com/users/mlpack/following{/other_user}","gists_url":"https://api.github.com/users/mlpack/gists{/gist_id}","starred_url":"https://api.github.com/users/mlpack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlpack/subscriptions","organizations_url":"https://api.github.com/users/mlpack/orgs","repos_url":"https://api.github.com/users/mlpack/repos","events_url":"https://api.github.com/users/mlpack/events{/privacy}","received_events_url":"https://api.github.com/users/mlpack/received_events","type":"Organization","site_admin":false},"repo":{"id":28149409,"name":"mlpack","full_name":"mlpack/mlpack","owner":{"login":"mlpack","id":10216045,"avatar_url":"https://avatars.githubusercontent.com/u/10216045?v=3","gravatar_id":"","url":"https://api.github.com/users/mlpack","html_url":"https://github.com/mlpack","followers_url":"https://api.github.com/users/mlpack/followers","following_url":"https://api.github.com/users/mlpack/following{/other_user}","gists_url":"https://api.github.com/users/mlpack/gists{/gist_id}","starred_url":"https://api.github.com/users/mlpack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlpack/subscriptions","organizations_url":"https://api.github.com/users/mlpack/orgs","repos_url":"https://api.github.com/users/mlpack/repos","events_url":"https://api.github.com/users/mlpack/events{/privacy}","received_events_url":"https://api.github.com/users/mlpack/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mlpack/mlpack","description":"mlpack: a scalable C++ machine learning library","fork":false,"url":"https://api.github.com/repos/mlpack/mlpack","forks_url":"https://api.github.com/repos/mlpack/mlpack/forks","keys_url":"https://api.github.com/repos/mlpack/mlpack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mlpack/mlpack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mlpack/mlpack/teams","hooks_url":"https://api.github.com/repos/mlpack/mlpack/hooks","issue_events_url":"https://api.github.com/repos/mlpack/mlpack/issues/events{/number}","events_url":"https://api.github.com/repos/mlpack/mlpack/events","assignees_url":"https://api.github.com/repos/mlpack/mlpack/assignees{/user}","branches_url":"https://api.github.com/repos/mlpack/mlpack/branches{/branch}","tags_url":"https://api.github.com/repos/mlpack/mlpack/tags","blobs_url":"https://api.github.com/repos/mlpack/mlpack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mlpack/mlpack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mlpack/mlpack/git/refs{/sha}","trees_url":"https://api.github.com/repos/mlpack/mlpack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mlpack/mlpack/statuses/{sha}","languages_url":"https://api.github.com/repos/mlpack/mlpack/languages","stargazers_url":"https://api.github.com/repos/mlpack/mlpack/stargazers","contributors_url":"https://api.github.com/repos/mlpack/mlpack/contributors","subscribers_url":"https://api.github.com/repos/mlpack/mlpack/subscribers","subscription_url":"https://api.github.com/repos/mlpack/mlpack/subscription","commits_url":"https://api.github.com/repos/mlpack/mlpack/commits{/sha}","git_commits_url":"https://api.github.com/repos/mlpack/mlpack/git/commits{/sha}","comments_url":"https://api.github.com/repos/mlpack/mlpack/comments{/number}","issue_comment_url":"https://api.github.com/repos/mlpack/mlpack/issues/comments{/number}","contents_url":"https://api.github.com/repos/mlpack/mlpack/contents/{+path}","compare_url":"https://api.github.com/repos/mlpack/mlpack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mlpack/mlpack/merges","archive_url":"https://api.github.com/repos/mlpack/mlpack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mlpack/mlpack/downloads","issues_url":"https://api.github.com/repos/mlpack/mlpack/issues{/number}","pulls_url":"https://api.github.com/repos/mlpack/mlpack/pulls{/number}","milestones_url":"https://api.github.com/repos/mlpack/mlpack/milestones{/number}","notifications_url":"https://api.github.com/repos/mlpack/mlpack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mlpack/mlpack/labels{/name}","releases_url":"https://api.github.com/repos/mlpack/mlpack/releases{/id}","deployments_url":"https://api.github.com/repos/mlpack/mlpack/deployments","created_at":"2014-12-17T18:16:59Z","updated_at":"2016-07-05T14:00:23Z","pushed_at":"2016-07-05T14:01:46Z","git_url":"git://github.com/mlpack/mlpack.git","ssh_url":"git@github.com:mlpack/mlpack.git","clone_url":"https://github.com/mlpack/mlpack.git","svn_url":"https://github.com/mlpack/mlpack","homepage":null,"size":166900,"stargazers_count":969,"watchers_count":969,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":357,"mirror_url":null,"open_issues_count":72,"forks":357,"open_issues":72,"watchers":969,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mlpack/mlpack/pulls/716"},"html":{"href":"https://github.com/mlpack/mlpack/pull/716"},"issue":{"href":"https://api.github.com/repos/mlpack/mlpack/issues/716"},"comments":{"href":"https://api.github.com/repos/mlpack/mlpack/issues/716/comments"},"review_comments":{"href":"https://api.github.com/repos/mlpack/mlpack/pulls/716/comments"},"review_comment":{"href":"https://api.github.com/repos/mlpack/mlpack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mlpack/mlpack/pulls/716/commits"},"statuses":{"href":"https://api.github.com/repos/mlpack/mlpack/statuses/1127e61b078faff9baefeeea5b9f75c925f8aed1"}}}}
{"actor":{"display_login":"zoq"}}