{"action":"created","comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/29802460","id":29802460,"diff_hunk":"@@ -0,0 +1,73 @@\n+cimport cython\n+cimport numpy as np\n+import numpy as np\n+\n+np.import_array()\n+\n+cdef np.float64_t NEGINF = -np.inf\n+\n+from libc.math cimport fabs\n+from scipy.special import psi\n+\n+\n+@cython.boundscheck(False)\n+@cython.wraparound(False)\n+def mean_change(np.ndarray[ndim=1, dtype=np.float64_t] arr_1,","path":"sklearn/decomposition/_online_lda.pyx","position":15,"original_position":15,"commit_id":"100ba3bc9ddb62b929bcb00bd9ecfaf6454c2b75","original_commit_id":"100ba3bc9ddb62b929bcb00bd9ecfaf6454c2b75","user":{"login":"amueller","id":449558,"avatar_url":"https://avatars.githubusercontent.com/u/449558?v=3","gravatar_id":"","url":"https://api.github.com/users/amueller","html_url":"https://github.com/amueller","followers_url":"https://api.github.com/users/amueller/followers","following_url":"https://api.github.com/users/amueller/following{/other_user}","gists_url":"https://api.github.com/users/amueller/gists{/gist_id}","starred_url":"https://api.github.com/users/amueller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amueller/subscriptions","organizations_url":"https://api.github.com/users/amueller/orgs","repos_url":"https://api.github.com/users/amueller/repos","events_url":"https://api.github.com/users/amueller/events{/privacy}","received_events_url":"https://api.github.com/users/amueller/received_events","type":"User","site_admin":false},"body":"I guess you benchmarked it, what is the speedup of doing this vs ``np.abs(arr_1 - arr_2).mean()``? I guess you save the allocation of two temporary arrays? Not sure since when ``abs`` has an ``out`` and if that would make it better....","created_at":"2015-05-06T21:09:38Z","updated_at":"2015-05-06T21:09:38Z","html_url":"https://github.com/scikit-learn/scikit-learn/pull/3659#discussion_r29802460","pull_request_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3659","_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/comments/29802460"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/3659#discussion_r29802460"},"pull_request":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3659"}}},"pull_request":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3659","id":21188463,"html_url":"https://github.com/scikit-learn/scikit-learn/pull/3659","diff_url":"https://github.com/scikit-learn/scikit-learn/pull/3659.diff","patch_url":"https://github.com/scikit-learn/scikit-learn/pull/3659.patch","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/3659","number":3659,"state":"open","locked":false,"title":"[MRG] implementing LDA(Latent Dirichlet Allocation) with online variational Bayes","user":{"login":"chyikwei","id":2423442,"avatar_url":"https://avatars.githubusercontent.com/u/2423442?v=3","gravatar_id":"","url":"https://api.github.com/users/chyikwei","html_url":"https://github.com/chyikwei","followers_url":"https://api.github.com/users/chyikwei/followers","following_url":"https://api.github.com/users/chyikwei/following{/other_user}","gists_url":"https://api.github.com/users/chyikwei/gists{/gist_id}","starred_url":"https://api.github.com/users/chyikwei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chyikwei/subscriptions","organizations_url":"https://api.github.com/users/chyikwei/orgs","repos_url":"https://api.github.com/users/chyikwei/repos","events_url":"https://api.github.com/users/chyikwei/events{/privacy}","received_events_url":"https://api.github.com/users/chyikwei/received_events","type":"User","site_admin":false},"body":"This PR is an implementation of Matt Hoffman's topic modeling algorithm `LDA with online variational Bayes`.\r\n\r\nBased on previous discussion in [this email thread](http://sourceforge.net/p/scikit-learn/mailman/message/32748341/), I asked Matt if he could relicense his `onlineldavb` code to BSD. And now his code is relicensed, so I create a PR for it.\r\n\r\nI use the name `OnlineLDA` for this model and put it in `decomposition` folder. And since the model can run both online and batch update, I implemented both `fit` and `partial_fit` method.\r\nThe algorithm part and unit test is done and ready for review. Will work on an example next.\r\n\r\n###### Check List:\r\n- [X] algorithm implementation\r\n- [X] unit test \r\n- [X] profiling\r\n- [x] optimization\r\n- [X] example\r\n- [x] documentation\r\n\r\n###### Reference:\r\n[1] [\"Online Learning for Latent Dirichlet Allocation\", Matthew D. Hoffman, David M. Blei, Francis Bach](https://www.cs.princeton.edu/~blei/papers/HoffmanBleiBach2010b.pdf)\r\n[2] [original onlineldavb code (with BSD license)](https://www.dropbox.com/s/wnkro3xtqjm7bli/onlineldavb_bsd.tar)","created_at":"2014-09-13T02:28:48Z","updated_at":"2015-05-06T21:09:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5cbe12b90738f68d35daa5193ad5ee26908d0390","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3659/commits","review_comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3659/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/3659/comments","statuses_url":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/100ba3bc9ddb62b929bcb00bd9ecfaf6454c2b75","head":{"label":"chyikwei:onlineldavb","ref":"onlineldavb","sha":"100ba3bc9ddb62b929bcb00bd9ecfaf6454c2b75","user":{"login":"chyikwei","id":2423442,"avatar_url":"https://avatars.githubusercontent.com/u/2423442?v=3","gravatar_id":"","url":"https://api.github.com/users/chyikwei","html_url":"https://github.com/chyikwei","followers_url":"https://api.github.com/users/chyikwei/followers","following_url":"https://api.github.com/users/chyikwei/following{/other_user}","gists_url":"https://api.github.com/users/chyikwei/gists{/gist_id}","starred_url":"https://api.github.com/users/chyikwei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chyikwei/subscriptions","organizations_url":"https://api.github.com/users/chyikwei/orgs","repos_url":"https://api.github.com/users/chyikwei/repos","events_url":"https://api.github.com/users/chyikwei/events{/privacy}","received_events_url":"https://api.github.com/users/chyikwei/received_events","type":"User","site_admin":false},"repo":{"id":23800539,"name":"scikit-learn","full_name":"chyikwei/scikit-learn","owner":{"login":"chyikwei","id":2423442,"avatar_url":"https://avatars.githubusercontent.com/u/2423442?v=3","gravatar_id":"","url":"https://api.github.com/users/chyikwei","html_url":"https://github.com/chyikwei","followers_url":"https://api.github.com/users/chyikwei/followers","following_url":"https://api.github.com/users/chyikwei/following{/other_user}","gists_url":"https://api.github.com/users/chyikwei/gists{/gist_id}","starred_url":"https://api.github.com/users/chyikwei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chyikwei/subscriptions","organizations_url":"https://api.github.com/users/chyikwei/orgs","repos_url":"https://api.github.com/users/chyikwei/repos","events_url":"https://api.github.com/users/chyikwei/events{/privacy}","received_events_url":"https://api.github.com/users/chyikwei/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chyikwei/scikit-learn","description":"scikit-learn: machine learning in Python","fork":true,"url":"https://api.github.com/repos/chyikwei/scikit-learn","forks_url":"https://api.github.com/repos/chyikwei/scikit-learn/forks","keys_url":"https://api.github.com/repos/chyikwei/scikit-learn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chyikwei/scikit-learn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chyikwei/scikit-learn/teams","hooks_url":"https://api.github.com/repos/chyikwei/scikit-learn/hooks","issue_events_url":"https://api.github.com/repos/chyikwei/scikit-learn/issues/events{/number}","events_url":"https://api.github.com/repos/chyikwei/scikit-learn/events","assignees_url":"https://api.github.com/repos/chyikwei/scikit-learn/assignees{/user}","branches_url":"https://api.github.com/repos/chyikwei/scikit-learn/branches{/branch}","tags_url":"https://api.github.com/repos/chyikwei/scikit-learn/tags","blobs_url":"https://api.github.com/repos/chyikwei/scikit-learn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chyikwei/scikit-learn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chyikwei/scikit-learn/git/refs{/sha}","trees_url":"https://api.github.com/repos/chyikwei/scikit-learn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chyikwei/scikit-learn/statuses/{sha}","languages_url":"https://api.github.com/repos/chyikwei/scikit-learn/languages","stargazers_url":"https://api.github.com/repos/chyikwei/scikit-learn/stargazers","contributors_url":"https://api.github.com/repos/chyikwei/scikit-learn/contributors","subscribers_url":"https://api.github.com/repos/chyikwei/scikit-learn/subscribers","subscription_url":"https://api.github.com/repos/chyikwei/scikit-learn/subscription","commits_url":"https://api.github.com/repos/chyikwei/scikit-learn/commits{/sha}","git_commits_url":"https://api.github.com/repos/chyikwei/scikit-learn/git/commits{/sha}","comments_url":"https://api.github.com/repos/chyikwei/scikit-learn/comments{/number}","issue_comment_url":"https://api.github.com/repos/chyikwei/scikit-learn/issues/comments{/number}","contents_url":"https://api.github.com/repos/chyikwei/scikit-learn/contents/{+path}","compare_url":"https://api.github.com/repos/chyikwei/scikit-learn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chyikwei/scikit-learn/merges","archive_url":"https://api.github.com/repos/chyikwei/scikit-learn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chyikwei/scikit-learn/downloads","issues_url":"https://api.github.com/repos/chyikwei/scikit-learn/issues{/number}","pulls_url":"https://api.github.com/repos/chyikwei/scikit-learn/pulls{/number}","milestones_url":"https://api.github.com/repos/chyikwei/scikit-learn/milestones{/number}","notifications_url":"https://api.github.com/repos/chyikwei/scikit-learn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chyikwei/scikit-learn/labels{/name}","releases_url":"https://api.github.com/repos/chyikwei/scikit-learn/releases{/id}","created_at":"2014-09-08T17:22:54Z","updated_at":"2015-04-06T16:33:09Z","pushed_at":"2015-05-01T19:31:03Z","git_url":"git://github.com/chyikwei/scikit-learn.git","ssh_url":"git@github.com:chyikwei/scikit-learn.git","clone_url":"https://github.com/chyikwei/scikit-learn.git","svn_url":"https://github.com/chyikwei/scikit-learn","homepage":"http://scikit-learn.org","size":60722,"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":"9d5c4c68887035d30347f05e59aa49ad95cdd834","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}","created_at":"2010-08-17T09:43:38Z","updated_at":"2015-05-06T18:49:46Z","pushed_at":"2015-05-06T16:01:36Z","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":125836,"stargazers_count":5913,"watchers_count":5913,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3530,"mirror_url":null,"open_issues_count":646,"forks":3530,"open_issues":646,"watchers":5913,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3659"},"html":{"href":"https://github.com/scikit-learn/scikit-learn/pull/3659"},"issue":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/3659"},"comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/3659/comments"},"review_comments":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/pulls/3659/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/3659/commits"},"statuses":{"href":"https://api.github.com/repos/scikit-learn/scikit-learn/statuses/100ba3bc9ddb62b929bcb00bd9ecfaf6454c2b75"}}}}