{"action":"created","comment":{"url":"https://api.github.com/repos/swager/grf/pulls/comments/198007949","pull_request_review_id":131858269,"id":198007949,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5ODAwNzk0OQ==","diff_hunk":"@@ -21,9 +21,48 @@\n #include \"forest/ForestTrainer.h\"\n #include \"forest/ForestTrainers.h\"\n #include \"utilities/ForestTestUtilities.h\"\n+#include <chrono>\n+#include <prediction/LocalLinearPredictionStrategy.h>\n+#include <prediction/collector/DefaultPredictionCollector.h>\n \n #include \"catch.hpp\"\n \n+TEST_CASE(\"LLF_friedman_2k\") {","path":"core/test/forest/LocalLinearForestTest.cpp","position":10,"original_position":10,"commit_id":"3fd7bb426b351b467ef7d910c7b67bcb6d7191ad","original_commit_id":"3fd7bb426b351b467ef7d910c7b67bcb6d7191ad","user":{"login":"jtibshirani","id":7461306,"node_id":"MDQ6VXNlcjc0NjEzMDY=","avatar_url":"https://avatars3.githubusercontent.com/u/7461306?v=4","gravatar_id":"","url":"https://api.github.com/users/jtibshirani","html_url":"https://github.com/jtibshirani","followers_url":"https://api.github.com/users/jtibshirani/followers","following_url":"https://api.github.com/users/jtibshirani/following{/other_user}","gists_url":"https://api.github.com/users/jtibshirani/gists{/gist_id}","starred_url":"https://api.github.com/users/jtibshirani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtibshirani/subscriptions","organizations_url":"https://api.github.com/users/jtibshirani/orgs","repos_url":"https://api.github.com/users/jtibshirani/repos","events_url":"https://api.github.com/users/jtibshirani/events{/privacy}","received_events_url":"https://api.github.com/users/jtibshirani/received_events","type":"User","site_admin":false},"body":"We try to write test case descriptions in plain English -- I think this one would be 'LLF gives reasonable predictions on data generated from the Friedman function'? Or is this a characterization test (i.e. it just exists to check that predictions have not changed too much as we make performance improvements)?","created_at":"2018-06-26T04:07:40Z","updated_at":"2018-06-26T04:08:17Z","html_url":"https://github.com/swager/grf/pull/254#discussion_r198007949","pull_request_url":"https://api.github.com/repos/swager/grf/pulls/254","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/swager/grf/pulls/comments/198007949"},"html":{"href":"https://github.com/swager/grf/pull/254#discussion_r198007949"},"pull_request":{"href":"https://api.github.com/repos/swager/grf/pulls/254"}}},"pull_request":{"url":"https://api.github.com/repos/swager/grf/pulls/254","id":196846880,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2ODQ2ODgw","html_url":"https://github.com/swager/grf/pull/254","diff_url":"https://github.com/swager/grf/pull/254.diff","patch_url":"https://github.com/swager/grf/pull/254.patch","issue_url":"https://api.github.com/repos/swager/grf/issues/254","number":254,"state":"open","locked":false,"title":"sparse diagonal weights optimization","user":{"login":"edgan8","id":2577963,"node_id":"MDQ6VXNlcjI1Nzc5NjM=","avatar_url":"https://avatars0.githubusercontent.com/u/2577963?v=4","gravatar_id":"","url":"https://api.github.com/users/edgan8","html_url":"https://github.com/edgan8","followers_url":"https://api.github.com/users/edgan8/followers","following_url":"https://api.github.com/users/edgan8/following{/other_user}","gists_url":"https://api.github.com/users/edgan8/gists{/gist_id}","starred_url":"https://api.github.com/users/edgan8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edgan8/subscriptions","organizations_url":"https://api.github.com/users/edgan8/orgs","repos_url":"https://api.github.com/users/edgan8/repos","events_url":"https://api.github.com/users/edgan8/events{/privacy}","received_events_url":"https://api.github.com/users/edgan8/received_events","type":"User","site_admin":false},"body":"Two local optimizations to improve local linear regression\r\n\r\n1) Treat the weights as a diagonal vector rather than a matrix. This avoids the cost of a large matrix multiply.\r\n2) Only fill in entries with nonzero weights. This reduces the size of the matrices substantially for small leaf sizes.\r\n\r\nIn the new LLFBench test, the runtime on a 2000x10 dataset goes from 70s originally -> 0.62s with optimization 1 -> 0.10s with both optimizations. The speedup is even more dramatic on larger datasets. Switching from QR decomposition on the covariance matrix to Cholesky also improves runtime slightly (~15%).\r\n\r\nfriedman.csv is a small dataset generated from:\r\n\r\n```\r\nn = 2000\r\nx = np.random.uniform(size=(10, n))\r\neps = np.random.normal(size=n)\r\ny = (\r\n    10*np.sin(math.pi*x[0]*x[1])\r\n    + 20*(x[2] - 0.5)**2\r\n    + 10*x[3]\r\n    + 5*x[4]\r\n    + eps\r\n)\r\n```","created_at":"2018-06-22T21:13:34Z","updated_at":"2018-06-26T04:08:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fcb3d72dc3d79e552d83af3ef6b0a494c503d7de","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/swager/grf/pulls/254/commits","review_comments_url":"https://api.github.com/repos/swager/grf/pulls/254/comments","review_comment_url":"https://api.github.com/repos/swager/grf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/swager/grf/issues/254/comments","statuses_url":"https://api.github.com/repos/swager/grf/statuses/3fd7bb426b351b467ef7d910c7b67bcb6d7191ad","head":{"label":"edgan8:fastlinear","ref":"fastlinear","sha":"3fd7bb426b351b467ef7d910c7b67bcb6d7191ad","user":{"login":"edgan8","id":2577963,"node_id":"MDQ6VXNlcjI1Nzc5NjM=","avatar_url":"https://avatars0.githubusercontent.com/u/2577963?v=4","gravatar_id":"","url":"https://api.github.com/users/edgan8","html_url":"https://github.com/edgan8","followers_url":"https://api.github.com/users/edgan8/followers","following_url":"https://api.github.com/users/edgan8/following{/other_user}","gists_url":"https://api.github.com/users/edgan8/gists{/gist_id}","starred_url":"https://api.github.com/users/edgan8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edgan8/subscriptions","organizations_url":"https://api.github.com/users/edgan8/orgs","repos_url":"https://api.github.com/users/edgan8/repos","events_url":"https://api.github.com/users/edgan8/events{/privacy}","received_events_url":"https://api.github.com/users/edgan8/received_events","type":"User","site_admin":false},"repo":{"id":138348382,"node_id":"MDEwOlJlcG9zaXRvcnkxMzgzNDgzODI=","name":"grf","full_name":"edgan8/grf","owner":{"login":"edgan8","id":2577963,"node_id":"MDQ6VXNlcjI1Nzc5NjM=","avatar_url":"https://avatars0.githubusercontent.com/u/2577963?v=4","gravatar_id":"","url":"https://api.github.com/users/edgan8","html_url":"https://github.com/edgan8","followers_url":"https://api.github.com/users/edgan8/followers","following_url":"https://api.github.com/users/edgan8/following{/other_user}","gists_url":"https://api.github.com/users/edgan8/gists{/gist_id}","starred_url":"https://api.github.com/users/edgan8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edgan8/subscriptions","organizations_url":"https://api.github.com/users/edgan8/orgs","repos_url":"https://api.github.com/users/edgan8/repos","events_url":"https://api.github.com/users/edgan8/events{/privacy}","received_events_url":"https://api.github.com/users/edgan8/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/edgan8/grf","description":"Generalized Random Forests","fork":true,"url":"https://api.github.com/repos/edgan8/grf","forks_url":"https://api.github.com/repos/edgan8/grf/forks","keys_url":"https://api.github.com/repos/edgan8/grf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edgan8/grf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edgan8/grf/teams","hooks_url":"https://api.github.com/repos/edgan8/grf/hooks","issue_events_url":"https://api.github.com/repos/edgan8/grf/issues/events{/number}","events_url":"https://api.github.com/repos/edgan8/grf/events","assignees_url":"https://api.github.com/repos/edgan8/grf/assignees{/user}","branches_url":"https://api.github.com/repos/edgan8/grf/branches{/branch}","tags_url":"https://api.github.com/repos/edgan8/grf/tags","blobs_url":"https://api.github.com/repos/edgan8/grf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edgan8/grf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edgan8/grf/git/refs{/sha}","trees_url":"https://api.github.com/repos/edgan8/grf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edgan8/grf/statuses/{sha}","languages_url":"https://api.github.com/repos/edgan8/grf/languages","stargazers_url":"https://api.github.com/repos/edgan8/grf/stargazers","contributors_url":"https://api.github.com/repos/edgan8/grf/contributors","subscribers_url":"https://api.github.com/repos/edgan8/grf/subscribers","subscription_url":"https://api.github.com/repos/edgan8/grf/subscription","commits_url":"https://api.github.com/repos/edgan8/grf/commits{/sha}","git_commits_url":"https://api.github.com/repos/edgan8/grf/git/commits{/sha}","comments_url":"https://api.github.com/repos/edgan8/grf/comments{/number}","issue_comment_url":"https://api.github.com/repos/edgan8/grf/issues/comments{/number}","contents_url":"https://api.github.com/repos/edgan8/grf/contents/{+path}","compare_url":"https://api.github.com/repos/edgan8/grf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edgan8/grf/merges","archive_url":"https://api.github.com/repos/edgan8/grf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edgan8/grf/downloads","issues_url":"https://api.github.com/repos/edgan8/grf/issues{/number}","pulls_url":"https://api.github.com/repos/edgan8/grf/pulls{/number}","milestones_url":"https://api.github.com/repos/edgan8/grf/milestones{/number}","notifications_url":"https://api.github.com/repos/edgan8/grf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edgan8/grf/labels{/name}","releases_url":"https://api.github.com/repos/edgan8/grf/releases{/id}","deployments_url":"https://api.github.com/repos/edgan8/grf/deployments","created_at":"2018-06-22T21:08:23Z","updated_at":"2018-06-22T21:08:25Z","pushed_at":"2018-06-25T22:40:55Z","git_url":"git://github.com/edgan8/grf.git","ssh_url":"git@github.com:edgan8/grf.git","clone_url":"https://github.com/edgan8/grf.git","svn_url":"https://github.com/edgan8/grf","homepage":"https://arxiv.org/abs/1610.01271","size":52774,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"swager:master","ref":"master","sha":"9c349c99392124e297a6a9af701c349d3801cdb8","user":{"login":"swager","id":1275702,"node_id":"MDQ6VXNlcjEyNzU3MDI=","avatar_url":"https://avatars1.githubusercontent.com/u/1275702?v=4","gravatar_id":"","url":"https://api.github.com/users/swager","html_url":"https://github.com/swager","followers_url":"https://api.github.com/users/swager/followers","following_url":"https://api.github.com/users/swager/following{/other_user}","gists_url":"https://api.github.com/users/swager/gists{/gist_id}","starred_url":"https://api.github.com/users/swager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swager/subscriptions","organizations_url":"https://api.github.com/users/swager/orgs","repos_url":"https://api.github.com/users/swager/repos","events_url":"https://api.github.com/users/swager/events{/privacy}","received_events_url":"https://api.github.com/users/swager/received_events","type":"User","site_admin":false},"repo":{"id":65554548,"node_id":"MDEwOlJlcG9zaXRvcnk2NTU1NDU0OA==","name":"grf","full_name":"swager/grf","owner":{"login":"swager","id":1275702,"node_id":"MDQ6VXNlcjEyNzU3MDI=","avatar_url":"https://avatars1.githubusercontent.com/u/1275702?v=4","gravatar_id":"","url":"https://api.github.com/users/swager","html_url":"https://github.com/swager","followers_url":"https://api.github.com/users/swager/followers","following_url":"https://api.github.com/users/swager/following{/other_user}","gists_url":"https://api.github.com/users/swager/gists{/gist_id}","starred_url":"https://api.github.com/users/swager/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swager/subscriptions","organizations_url":"https://api.github.com/users/swager/orgs","repos_url":"https://api.github.com/users/swager/repos","events_url":"https://api.github.com/users/swager/events{/privacy}","received_events_url":"https://api.github.com/users/swager/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/swager/grf","description":"Generalized Random Forests","fork":false,"url":"https://api.github.com/repos/swager/grf","forks_url":"https://api.github.com/repos/swager/grf/forks","keys_url":"https://api.github.com/repos/swager/grf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/swager/grf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/swager/grf/teams","hooks_url":"https://api.github.com/repos/swager/grf/hooks","issue_events_url":"https://api.github.com/repos/swager/grf/issues/events{/number}","events_url":"https://api.github.com/repos/swager/grf/events","assignees_url":"https://api.github.com/repos/swager/grf/assignees{/user}","branches_url":"https://api.github.com/repos/swager/grf/branches{/branch}","tags_url":"https://api.github.com/repos/swager/grf/tags","blobs_url":"https://api.github.com/repos/swager/grf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/swager/grf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/swager/grf/git/refs{/sha}","trees_url":"https://api.github.com/repos/swager/grf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/swager/grf/statuses/{sha}","languages_url":"https://api.github.com/repos/swager/grf/languages","stargazers_url":"https://api.github.com/repos/swager/grf/stargazers","contributors_url":"https://api.github.com/repos/swager/grf/contributors","subscribers_url":"https://api.github.com/repos/swager/grf/subscribers","subscription_url":"https://api.github.com/repos/swager/grf/subscription","commits_url":"https://api.github.com/repos/swager/grf/commits{/sha}","git_commits_url":"https://api.github.com/repos/swager/grf/git/commits{/sha}","comments_url":"https://api.github.com/repos/swager/grf/comments{/number}","issue_comment_url":"https://api.github.com/repos/swager/grf/issues/comments{/number}","contents_url":"https://api.github.com/repos/swager/grf/contents/{+path}","compare_url":"https://api.github.com/repos/swager/grf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/swager/grf/merges","archive_url":"https://api.github.com/repos/swager/grf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/swager/grf/downloads","issues_url":"https://api.github.com/repos/swager/grf/issues{/number}","pulls_url":"https://api.github.com/repos/swager/grf/pulls{/number}","milestones_url":"https://api.github.com/repos/swager/grf/milestones{/number}","notifications_url":"https://api.github.com/repos/swager/grf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/swager/grf/labels{/name}","releases_url":"https://api.github.com/repos/swager/grf/releases{/id}","deployments_url":"https://api.github.com/repos/swager/grf/deployments","created_at":"2016-08-12T13:17:37Z","updated_at":"2018-06-24T22:51:43Z","pushed_at":"2018-06-25T22:40:56Z","git_url":"git://github.com/swager/grf.git","ssh_url":"git@github.com:swager/grf.git","clone_url":"https://github.com/swager/grf.git","svn_url":"https://github.com/swager/grf","homepage":"https://arxiv.org/abs/1610.01271","size":52578,"stargazers_count":124,"watchers_count":124,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":30,"mirror_url":null,"archived":false,"open_issues_count":32,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":30,"open_issues":32,"watchers":124,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/swager/grf/pulls/254"},"html":{"href":"https://github.com/swager/grf/pull/254"},"issue":{"href":"https://api.github.com/repos/swager/grf/issues/254"},"comments":{"href":"https://api.github.com/repos/swager/grf/issues/254/comments"},"review_comments":{"href":"https://api.github.com/repos/swager/grf/pulls/254/comments"},"review_comment":{"href":"https://api.github.com/repos/swager/grf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/swager/grf/pulls/254/commits"},"statuses":{"href":"https://api.github.com/repos/swager/grf/statuses/3fd7bb426b351b467ef7d910c7b67bcb6d7191ad"}},"author_association":"NONE"}}
{"actor":{"display_login":"jtibshirani"}}