{"action":"created","comment":{"url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/comments/56964109","id":56964109,"diff_hunk":"@@ -43,82 +42,29 @@ void CKernelRidgeRegression::init()\n \tSG_ADD(&m_tau, \"tau\", \"Regularization parameter\", MS_AVAILABLE);\n }\n \n-bool CKernelRidgeRegression::train_machine_pinv()\n+bool CKernelRidgeRegression::solve_krr_system()\n {\n-\t// Get kernel matrix\n-\tSGMatrix<float64_t> kernel_matrix=kernel->get_kernel_matrix<float64_t>();\n-\tint32_t n = kernel_matrix.num_cols;\n-\tint32_t m = kernel_matrix.num_rows;\n-\tASSERT(kernel_matrix.matrix && m>0 && n>0)\n+\tSGMatrix<float64_t> kernel_matrix(kernel->get_kernel_matrix());\n+\tint32_t n = kernel_matrix.num_rows;\n+\tSGVector<float64_t> y = ((CRegressionLabels*)m_labels)->get_labels();\n \n-\tfor(int32_t i=0; i < n; i++)\n-\t\tkernel_matrix.matrix[i+i*n]+=m_tau;\n-\n-\t/* re-set alphas of kernel machine */\n-\tm_alpha=((CRegressionLabels*) m_labels)->get_labels_copy();\n-\n-\t/* tell kernel machine that all alphas are needed as'support vectors' */\n-\tm_svs=SGVector<index_t>(m_alpha.vlen);\n-\tm_svs.range_fill();\n-\n-\tif (get_alphas().vlen!=n)\n+\tfor(index_t i=0; i<n; i++)\n \t{\n-\t\tSG_ERROR(\"Number of labels does not match number of kernel\"\n-\t\t\t\t\" columns (num_labels=%d cols=%d\\n\", m_alpha.vlen, n);\n+\t\tm_alpha[i] = y[i];","path":"src/shogun/regression/KernelRidgeRegression.cpp","position":64,"original_position":64,"commit_id":"7fa0b0b9773777374f2a88923e0ae022723f24d3","original_commit_id":"7fa0b0b9773777374f2a88923e0ae022723f24d3","user":{"login":"karlnapf","id":699071,"avatar_url":"https://avatars.githubusercontent.com/u/699071?v=3","gravatar_id":"","url":"https://api.github.com/users/karlnapf","html_url":"https://github.com/karlnapf","followers_url":"https://api.github.com/users/karlnapf/followers","following_url":"https://api.github.com/users/karlnapf/following{/other_user}","gists_url":"https://api.github.com/users/karlnapf/gists{/gist_id}","starred_url":"https://api.github.com/users/karlnapf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karlnapf/subscriptions","organizations_url":"https://api.github.com/users/karlnapf/orgs","repos_url":"https://api.github.com/users/karlnapf/repos","events_url":"https://api.github.com/users/karlnapf/events{/privacy}","received_events_url":"https://api.github.com/users/karlnapf/received_events","type":"User","site_admin":false},"body":"this is not really needed, you can just have another eigen3 map","created_at":"2016-03-22T10:29:48Z","updated_at":"2016-03-22T10:29:48Z","html_url":"https://github.com/shogun-toolbox/shogun/pull/3098#discussion_r56964109","pull_request_url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/3098","_links":{"self":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/comments/56964109"},"html":{"href":"https://github.com/shogun-toolbox/shogun/pull/3098#discussion_r56964109"},"pull_request":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/3098"}}},"pull_request":{"url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/3098","id":63475760,"html_url":"https://github.com/shogun-toolbox/shogun/pull/3098","diff_url":"https://github.com/shogun-toolbox/shogun/pull/3098.diff","patch_url":"https://github.com/shogun-toolbox/shogun/pull/3098.patch","issue_url":"https://api.github.com/repos/shogun-toolbox/shogun/issues/3098","number":3098,"state":"open","locked":false,"title":"trian krr by using eigen3 llt","user":{"login":"sanuj","id":4343847,"avatar_url":"https://avatars.githubusercontent.com/u/4343847?v=3","gravatar_id":"","url":"https://api.github.com/users/sanuj","html_url":"https://github.com/sanuj","followers_url":"https://api.github.com/users/sanuj/followers","following_url":"https://api.github.com/users/sanuj/following{/other_user}","gists_url":"https://api.github.com/users/sanuj/gists{/gist_id}","starred_url":"https://api.github.com/users/sanuj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanuj/subscriptions","organizations_url":"https://api.github.com/users/sanuj/orgs","repos_url":"https://api.github.com/users/sanuj/repos","events_url":"https://api.github.com/users/sanuj/events{/privacy}","received_events_url":"https://api.github.com/users/sanuj/received_events","type":"User","site_admin":false},"body":"For #3095. KRR uses Eigen3's LLT now.\r\nI haven't added any unit tests as other regression unit tests have taken reference data from some other ml toolbox. Shall I also prepare small data and run it on scikit learn to use it's results in our unit tests?\r\nApart from that, there are 2 tests related to KRR. One is `generated_cpp-kernel_ridge_regression` and the other one is `evaluation_cross_validation_regression`. Both are passing.","created_at":"2016-03-19T19:01:59Z","updated_at":"2016-03-22T10:29:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5e4763d5dad9b4d4920c2efd0fdb2284f1082229","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/3098/commits","review_comments_url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/3098/comments","review_comment_url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shogun-toolbox/shogun/issues/3098/comments","statuses_url":"https://api.github.com/repos/shogun-toolbox/shogun/statuses/7fa0b0b9773777374f2a88923e0ae022723f24d3","head":{"label":"sanuj:krr_refactor","ref":"krr_refactor","sha":"7fa0b0b9773777374f2a88923e0ae022723f24d3","user":{"login":"sanuj","id":4343847,"avatar_url":"https://avatars.githubusercontent.com/u/4343847?v=3","gravatar_id":"","url":"https://api.github.com/users/sanuj","html_url":"https://github.com/sanuj","followers_url":"https://api.github.com/users/sanuj/followers","following_url":"https://api.github.com/users/sanuj/following{/other_user}","gists_url":"https://api.github.com/users/sanuj/gists{/gist_id}","starred_url":"https://api.github.com/users/sanuj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanuj/subscriptions","organizations_url":"https://api.github.com/users/sanuj/orgs","repos_url":"https://api.github.com/users/sanuj/repos","events_url":"https://api.github.com/users/sanuj/events{/privacy}","received_events_url":"https://api.github.com/users/sanuj/received_events","type":"User","site_admin":false},"repo":{"id":27362302,"name":"shogun","full_name":"sanuj/shogun","owner":{"login":"sanuj","id":4343847,"avatar_url":"https://avatars.githubusercontent.com/u/4343847?v=3","gravatar_id":"","url":"https://api.github.com/users/sanuj","html_url":"https://github.com/sanuj","followers_url":"https://api.github.com/users/sanuj/followers","following_url":"https://api.github.com/users/sanuj/following{/other_user}","gists_url":"https://api.github.com/users/sanuj/gists{/gist_id}","starred_url":"https://api.github.com/users/sanuj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanuj/subscriptions","organizations_url":"https://api.github.com/users/sanuj/orgs","repos_url":"https://api.github.com/users/sanuj/repos","events_url":"https://api.github.com/users/sanuj/events{/privacy}","received_events_url":"https://api.github.com/users/sanuj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sanuj/shogun","description":"The Shogun Machine Learning Toolbox (Source Code)","fork":true,"url":"https://api.github.com/repos/sanuj/shogun","forks_url":"https://api.github.com/repos/sanuj/shogun/forks","keys_url":"https://api.github.com/repos/sanuj/shogun/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sanuj/shogun/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sanuj/shogun/teams","hooks_url":"https://api.github.com/repos/sanuj/shogun/hooks","issue_events_url":"https://api.github.com/repos/sanuj/shogun/issues/events{/number}","events_url":"https://api.github.com/repos/sanuj/shogun/events","assignees_url":"https://api.github.com/repos/sanuj/shogun/assignees{/user}","branches_url":"https://api.github.com/repos/sanuj/shogun/branches{/branch}","tags_url":"https://api.github.com/repos/sanuj/shogun/tags","blobs_url":"https://api.github.com/repos/sanuj/shogun/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sanuj/shogun/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sanuj/shogun/git/refs{/sha}","trees_url":"https://api.github.com/repos/sanuj/shogun/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sanuj/shogun/statuses/{sha}","languages_url":"https://api.github.com/repos/sanuj/shogun/languages","stargazers_url":"https://api.github.com/repos/sanuj/shogun/stargazers","contributors_url":"https://api.github.com/repos/sanuj/shogun/contributors","subscribers_url":"https://api.github.com/repos/sanuj/shogun/subscribers","subscription_url":"https://api.github.com/repos/sanuj/shogun/subscription","commits_url":"https://api.github.com/repos/sanuj/shogun/commits{/sha}","git_commits_url":"https://api.github.com/repos/sanuj/shogun/git/commits{/sha}","comments_url":"https://api.github.com/repos/sanuj/shogun/comments{/number}","issue_comment_url":"https://api.github.com/repos/sanuj/shogun/issues/comments{/number}","contents_url":"https://api.github.com/repos/sanuj/shogun/contents/{+path}","compare_url":"https://api.github.com/repos/sanuj/shogun/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sanuj/shogun/merges","archive_url":"https://api.github.com/repos/sanuj/shogun/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sanuj/shogun/downloads","issues_url":"https://api.github.com/repos/sanuj/shogun/issues{/number}","pulls_url":"https://api.github.com/repos/sanuj/shogun/pulls{/number}","milestones_url":"https://api.github.com/repos/sanuj/shogun/milestones{/number}","notifications_url":"https://api.github.com/repos/sanuj/shogun/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sanuj/shogun/labels{/name}","releases_url":"https://api.github.com/repos/sanuj/shogun/releases{/id}","deployments_url":"https://api.github.com/repos/sanuj/shogun/deployments","created_at":"2014-12-01T04:19:55Z","updated_at":"2016-02-21T03:45:13Z","pushed_at":"2016-03-22T09:43:35Z","git_url":"git://github.com/sanuj/shogun.git","ssh_url":"git@github.com:sanuj/shogun.git","clone_url":"https://github.com/sanuj/shogun.git","svn_url":"https://github.com/sanuj/shogun","homepage":"http://www.shogun-toolbox.org","size":59047,"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":"develop"}},"base":{"label":"shogun-toolbox:develop","ref":"develop","sha":"40228bc1eedc6830036e2eea8cc147d02691f8e3","user":{"login":"shogun-toolbox","id":690673,"avatar_url":"https://avatars.githubusercontent.com/u/690673?v=3","gravatar_id":"","url":"https://api.github.com/users/shogun-toolbox","html_url":"https://github.com/shogun-toolbox","followers_url":"https://api.github.com/users/shogun-toolbox/followers","following_url":"https://api.github.com/users/shogun-toolbox/following{/other_user}","gists_url":"https://api.github.com/users/shogun-toolbox/gists{/gist_id}","starred_url":"https://api.github.com/users/shogun-toolbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shogun-toolbox/subscriptions","organizations_url":"https://api.github.com/users/shogun-toolbox/orgs","repos_url":"https://api.github.com/users/shogun-toolbox/repos","events_url":"https://api.github.com/users/shogun-toolbox/events{/privacy}","received_events_url":"https://api.github.com/users/shogun-toolbox/received_events","type":"Organization","site_admin":false},"repo":{"id":1555094,"name":"shogun","full_name":"shogun-toolbox/shogun","owner":{"login":"shogun-toolbox","id":690673,"avatar_url":"https://avatars.githubusercontent.com/u/690673?v=3","gravatar_id":"","url":"https://api.github.com/users/shogun-toolbox","html_url":"https://github.com/shogun-toolbox","followers_url":"https://api.github.com/users/shogun-toolbox/followers","following_url":"https://api.github.com/users/shogun-toolbox/following{/other_user}","gists_url":"https://api.github.com/users/shogun-toolbox/gists{/gist_id}","starred_url":"https://api.github.com/users/shogun-toolbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shogun-toolbox/subscriptions","organizations_url":"https://api.github.com/users/shogun-toolbox/orgs","repos_url":"https://api.github.com/users/shogun-toolbox/repos","events_url":"https://api.github.com/users/shogun-toolbox/events{/privacy}","received_events_url":"https://api.github.com/users/shogun-toolbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/shogun-toolbox/shogun","description":"The Shogun Machine Learning Toolbox (Source Code)","fork":false,"url":"https://api.github.com/repos/shogun-toolbox/shogun","forks_url":"https://api.github.com/repos/shogun-toolbox/shogun/forks","keys_url":"https://api.github.com/repos/shogun-toolbox/shogun/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shogun-toolbox/shogun/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shogun-toolbox/shogun/teams","hooks_url":"https://api.github.com/repos/shogun-toolbox/shogun/hooks","issue_events_url":"https://api.github.com/repos/shogun-toolbox/shogun/issues/events{/number}","events_url":"https://api.github.com/repos/shogun-toolbox/shogun/events","assignees_url":"https://api.github.com/repos/shogun-toolbox/shogun/assignees{/user}","branches_url":"https://api.github.com/repos/shogun-toolbox/shogun/branches{/branch}","tags_url":"https://api.github.com/repos/shogun-toolbox/shogun/tags","blobs_url":"https://api.github.com/repos/shogun-toolbox/shogun/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shogun-toolbox/shogun/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shogun-toolbox/shogun/git/refs{/sha}","trees_url":"https://api.github.com/repos/shogun-toolbox/shogun/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shogun-toolbox/shogun/statuses/{sha}","languages_url":"https://api.github.com/repos/shogun-toolbox/shogun/languages","stargazers_url":"https://api.github.com/repos/shogun-toolbox/shogun/stargazers","contributors_url":"https://api.github.com/repos/shogun-toolbox/shogun/contributors","subscribers_url":"https://api.github.com/repos/shogun-toolbox/shogun/subscribers","subscription_url":"https://api.github.com/repos/shogun-toolbox/shogun/subscription","commits_url":"https://api.github.com/repos/shogun-toolbox/shogun/commits{/sha}","git_commits_url":"https://api.github.com/repos/shogun-toolbox/shogun/git/commits{/sha}","comments_url":"https://api.github.com/repos/shogun-toolbox/shogun/comments{/number}","issue_comment_url":"https://api.github.com/repos/shogun-toolbox/shogun/issues/comments{/number}","contents_url":"https://api.github.com/repos/shogun-toolbox/shogun/contents/{+path}","compare_url":"https://api.github.com/repos/shogun-toolbox/shogun/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shogun-toolbox/shogun/merges","archive_url":"https://api.github.com/repos/shogun-toolbox/shogun/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shogun-toolbox/shogun/downloads","issues_url":"https://api.github.com/repos/shogun-toolbox/shogun/issues{/number}","pulls_url":"https://api.github.com/repos/shogun-toolbox/shogun/pulls{/number}","milestones_url":"https://api.github.com/repos/shogun-toolbox/shogun/milestones{/number}","notifications_url":"https://api.github.com/repos/shogun-toolbox/shogun/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shogun-toolbox/shogun/labels{/name}","releases_url":"https://api.github.com/repos/shogun-toolbox/shogun/releases{/id}","deployments_url":"https://api.github.com/repos/shogun-toolbox/shogun/deployments","created_at":"2011-04-01T10:44:32Z","updated_at":"2016-03-21T03:59:02Z","pushed_at":"2016-03-22T09:43:36Z","git_url":"git://github.com/shogun-toolbox/shogun.git","ssh_url":"git@github.com:shogun-toolbox/shogun.git","clone_url":"https://github.com/shogun-toolbox/shogun.git","svn_url":"https://github.com/shogun-toolbox/shogun","homepage":"http://www.shogun-toolbox.org","size":180831,"stargazers_count":1009,"watchers_count":1009,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":546,"mirror_url":null,"open_issues_count":413,"forks":546,"open_issues":413,"watchers":1009,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/3098"},"html":{"href":"https://github.com/shogun-toolbox/shogun/pull/3098"},"issue":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/issues/3098"},"comments":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/issues/3098/comments"},"review_comments":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/3098/comments"},"review_comment":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/pulls/3098/commits"},"statuses":{"href":"https://api.github.com/repos/shogun-toolbox/shogun/statuses/7fa0b0b9773777374f2a88923e0ae022723f24d3"}}}}