{"action":"created","comment":{"url":"https://api.github.com/repos/msmbuilder/msmbuilder/pulls/comments/57258500","id":57258500,"diff_hunk":"@@ -0,0 +1,157 @@\n+# Author: Evan N. Feinberg <efein19@gmail.com>\n+# Contributors: Christian Schwantes <schwancr@gmail.com>m Robert McGibbon <rmcgibbo@gmail.com>, Kyle A. Beauchamp  <kyleabeauchamp@gmail.com>","path":"msmbuilder/preprocessing/normalize.py","position":2,"original_position":2,"commit_id":"23d11bbdf947dec7ea61d218a54b9d4b9d7c8163","original_commit_id":"23d11bbdf947dec7ea61d218a54b9d4b9d7c8163","user":{"login":"evanfeinberg","id":1760982,"avatar_url":"https://avatars.githubusercontent.com/u/1760982?v=3","gravatar_id":"","url":"https://api.github.com/users/evanfeinberg","html_url":"https://github.com/evanfeinberg","followers_url":"https://api.github.com/users/evanfeinberg/followers","following_url":"https://api.github.com/users/evanfeinberg/following{/other_user}","gists_url":"https://api.github.com/users/evanfeinberg/gists{/gist_id}","starred_url":"https://api.github.com/users/evanfeinberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evanfeinberg/subscriptions","organizations_url":"https://api.github.com/users/evanfeinberg/orgs","repos_url":"https://api.github.com/users/evanfeinberg/repos","events_url":"https://api.github.com/users/evanfeinberg/events{/privacy}","received_events_url":"https://api.github.com/users/evanfeinberg/received_events","type":"User","site_admin":false},"body":"Oops you're totally right, corrected.","created_at":"2016-03-24T00:13:31Z","updated_at":"2016-03-24T00:13:31Z","html_url":"https://github.com/msmbuilder/msmbuilder/pull/770#discussion_r57258500","pull_request_url":"https://api.github.com/repos/msmbuilder/msmbuilder/pulls/770","_links":{"self":{"href":"https://api.github.com/repos/msmbuilder/msmbuilder/pulls/comments/57258500"},"html":{"href":"https://github.com/msmbuilder/msmbuilder/pull/770#discussion_r57258500"},"pull_request":{"href":"https://api.github.com/repos/msmbuilder/msmbuilder/pulls/770"}}},"pull_request":{"url":"https://api.github.com/repos/msmbuilder/msmbuilder/pulls/770","id":63967717,"html_url":"https://github.com/msmbuilder/msmbuilder/pull/770","diff_url":"https://github.com/msmbuilder/msmbuilder/pull/770.diff","patch_url":"https://github.com/msmbuilder/msmbuilder/pull/770.patch","issue_url":"https://api.github.com/repos/msmbuilder/msmbuilder/issues/770","number":770,"state":"open","locked":false,"title":"added ability to normalize large datasets in memory","user":{"login":"evanfeinberg","id":1760982,"avatar_url":"https://avatars.githubusercontent.com/u/1760982?v=3","gravatar_id":"","url":"https://api.github.com/users/evanfeinberg","html_url":"https://github.com/evanfeinberg","followers_url":"https://api.github.com/users/evanfeinberg/followers","following_url":"https://api.github.com/users/evanfeinberg/following{/other_user}","gists_url":"https://api.github.com/users/evanfeinberg/gists{/gist_id}","starred_url":"https://api.github.com/users/evanfeinberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evanfeinberg/subscriptions","organizations_url":"https://api.github.com/users/evanfeinberg/orgs","repos_url":"https://api.github.com/users/evanfeinberg/repos","events_url":"https://api.github.com/users/evanfeinberg/events{/privacy}","received_events_url":"https://api.github.com/users/evanfeinberg/received_events","type":"User","site_admin":false},"body":" This PR adds a \"preprocessing\" section which is inspired by the approach of geometric clustering in `MSMBuilder`: take standard `sklearn` methods and expand them to handle `list`s of `np.array`s. This is more convenient, as nearly all `sklearn` methods assume that `X` is a single `np.array` whereas MD data is mostly stored in lists of arrays. \r\n\r\nLarge featurized [MD] datasets are often large compared to total RAM available on a system. If size of the MD dataset is comparable to the total RAM available, then computing the mean and variance with standard `numpy` functions can be tricky. Since concatenating the data essentially doubles the RAM that needs to be used, the usual way of computing mean and variance can in turn make the user exceed the memory limits of the system.\r\n\r\nTo begin, I implemented a numerically stable method described in https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Compensated_variant. In addition to the normal `fit`, `transform`, and `fit_transform` methods, I added `fit_transform_in_place` and `transform_in_place`, so one can pass in un-normalized features and compute normalized features without adding to the memory burden of one's computation. \r\n\r\nSome to-do's: add whitening and other preprocessing capabilities from `sklearn` to `msmbuilder.preprocessing`. \r\n\r\nComments or criticisms are welcome. Thank you to @cxhernandez  in particular for his help with this PR.","created_at":"2016-03-23T23:11:36Z","updated_at":"2016-03-24T00:13:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9c9cf21ad2ef717fddd2c13bcaa4dd26df62953c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/msmbuilder/msmbuilder/pulls/770/commits","review_comments_url":"https://api.github.com/repos/msmbuilder/msmbuilder/pulls/770/comments","review_comment_url":"https://api.github.com/repos/msmbuilder/msmbuilder/pulls/comments{/number}","comments_url":"https://api.github.com/repos/msmbuilder/msmbuilder/issues/770/comments","statuses_url":"https://api.github.com/repos/msmbuilder/msmbuilder/statuses/23d11bbdf947dec7ea61d218a54b9d4b9d7c8163","head":{"label":"evanfeinberg:preprocessing","ref":"preprocessing","sha":"23d11bbdf947dec7ea61d218a54b9d4b9d7c8163","user":{"login":"evanfeinberg","id":1760982,"avatar_url":"https://avatars.githubusercontent.com/u/1760982?v=3","gravatar_id":"","url":"https://api.github.com/users/evanfeinberg","html_url":"https://github.com/evanfeinberg","followers_url":"https://api.github.com/users/evanfeinberg/followers","following_url":"https://api.github.com/users/evanfeinberg/following{/other_user}","gists_url":"https://api.github.com/users/evanfeinberg/gists{/gist_id}","starred_url":"https://api.github.com/users/evanfeinberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evanfeinberg/subscriptions","organizations_url":"https://api.github.com/users/evanfeinberg/orgs","repos_url":"https://api.github.com/users/evanfeinberg/repos","events_url":"https://api.github.com/users/evanfeinberg/events{/privacy}","received_events_url":"https://api.github.com/users/evanfeinberg/received_events","type":"User","site_admin":false},"repo":{"id":54598876,"name":"msmbuilder","full_name":"evanfeinberg/msmbuilder","owner":{"login":"evanfeinberg","id":1760982,"avatar_url":"https://avatars.githubusercontent.com/u/1760982?v=3","gravatar_id":"","url":"https://api.github.com/users/evanfeinberg","html_url":"https://github.com/evanfeinberg","followers_url":"https://api.github.com/users/evanfeinberg/followers","following_url":"https://api.github.com/users/evanfeinberg/following{/other_user}","gists_url":"https://api.github.com/users/evanfeinberg/gists{/gist_id}","starred_url":"https://api.github.com/users/evanfeinberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evanfeinberg/subscriptions","organizations_url":"https://api.github.com/users/evanfeinberg/orgs","repos_url":"https://api.github.com/users/evanfeinberg/repos","events_url":"https://api.github.com/users/evanfeinberg/events{/privacy}","received_events_url":"https://api.github.com/users/evanfeinberg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/evanfeinberg/msmbuilder","description":"Statistical models for biomolecular dynamics","fork":true,"url":"https://api.github.com/repos/evanfeinberg/msmbuilder","forks_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/forks","keys_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/teams","hooks_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/hooks","issue_events_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/issues/events{/number}","events_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/events","assignees_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/assignees{/user}","branches_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/branches{/branch}","tags_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/tags","blobs_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/git/refs{/sha}","trees_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/statuses/{sha}","languages_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/languages","stargazers_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/stargazers","contributors_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/contributors","subscribers_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/subscribers","subscription_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/subscription","commits_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/commits{/sha}","git_commits_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/git/commits{/sha}","comments_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/comments{/number}","issue_comment_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/issues/comments{/number}","contents_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/contents/{+path}","compare_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/merges","archive_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/downloads","issues_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/issues{/number}","pulls_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/pulls{/number}","milestones_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/milestones{/number}","notifications_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/labels{/name}","releases_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/releases{/id}","deployments_url":"https://api.github.com/repos/evanfeinberg/msmbuilder/deployments","created_at":"2016-03-23T23:00:19Z","updated_at":"2016-03-23T23:00:20Z","pushed_at":"2016-03-23T23:03:04Z","git_url":"git://github.com/evanfeinberg/msmbuilder.git","ssh_url":"git@github.com:evanfeinberg/msmbuilder.git","clone_url":"https://github.com/evanfeinberg/msmbuilder.git","svn_url":"https://github.com/evanfeinberg/msmbuilder","homepage":"http://msmbuilder.org","size":5345,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"msmbuilder:master","ref":"master","sha":"97ce305ad2f3201400e6d95885a144e614abb0a8","user":{"login":"msmbuilder","id":10036752,"avatar_url":"https://avatars.githubusercontent.com/u/10036752?v=3","gravatar_id":"","url":"https://api.github.com/users/msmbuilder","html_url":"https://github.com/msmbuilder","followers_url":"https://api.github.com/users/msmbuilder/followers","following_url":"https://api.github.com/users/msmbuilder/following{/other_user}","gists_url":"https://api.github.com/users/msmbuilder/gists{/gist_id}","starred_url":"https://api.github.com/users/msmbuilder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msmbuilder/subscriptions","organizations_url":"https://api.github.com/users/msmbuilder/orgs","repos_url":"https://api.github.com/users/msmbuilder/repos","events_url":"https://api.github.com/users/msmbuilder/events{/privacy}","received_events_url":"https://api.github.com/users/msmbuilder/received_events","type":"Organization","site_admin":false},"repo":{"id":13510362,"name":"msmbuilder","full_name":"msmbuilder/msmbuilder","owner":{"login":"msmbuilder","id":10036752,"avatar_url":"https://avatars.githubusercontent.com/u/10036752?v=3","gravatar_id":"","url":"https://api.github.com/users/msmbuilder","html_url":"https://github.com/msmbuilder","followers_url":"https://api.github.com/users/msmbuilder/followers","following_url":"https://api.github.com/users/msmbuilder/following{/other_user}","gists_url":"https://api.github.com/users/msmbuilder/gists{/gist_id}","starred_url":"https://api.github.com/users/msmbuilder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msmbuilder/subscriptions","organizations_url":"https://api.github.com/users/msmbuilder/orgs","repos_url":"https://api.github.com/users/msmbuilder/repos","events_url":"https://api.github.com/users/msmbuilder/events{/privacy}","received_events_url":"https://api.github.com/users/msmbuilder/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/msmbuilder/msmbuilder","description":"Statistical models for biomolecular dynamics","fork":false,"url":"https://api.github.com/repos/msmbuilder/msmbuilder","forks_url":"https://api.github.com/repos/msmbuilder/msmbuilder/forks","keys_url":"https://api.github.com/repos/msmbuilder/msmbuilder/keys{/key_id}","collaborators_url":"https://api.github.com/repos/msmbuilder/msmbuilder/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/msmbuilder/msmbuilder/teams","hooks_url":"https://api.github.com/repos/msmbuilder/msmbuilder/hooks","issue_events_url":"https://api.github.com/repos/msmbuilder/msmbuilder/issues/events{/number}","events_url":"https://api.github.com/repos/msmbuilder/msmbuilder/events","assignees_url":"https://api.github.com/repos/msmbuilder/msmbuilder/assignees{/user}","branches_url":"https://api.github.com/repos/msmbuilder/msmbuilder/branches{/branch}","tags_url":"https://api.github.com/repos/msmbuilder/msmbuilder/tags","blobs_url":"https://api.github.com/repos/msmbuilder/msmbuilder/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/msmbuilder/msmbuilder/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/msmbuilder/msmbuilder/git/refs{/sha}","trees_url":"https://api.github.com/repos/msmbuilder/msmbuilder/git/trees{/sha}","statuses_url":"https://api.github.com/repos/msmbuilder/msmbuilder/statuses/{sha}","languages_url":"https://api.github.com/repos/msmbuilder/msmbuilder/languages","stargazers_url":"https://api.github.com/repos/msmbuilder/msmbuilder/stargazers","contributors_url":"https://api.github.com/repos/msmbuilder/msmbuilder/contributors","subscribers_url":"https://api.github.com/repos/msmbuilder/msmbuilder/subscribers","subscription_url":"https://api.github.com/repos/msmbuilder/msmbuilder/subscription","commits_url":"https://api.github.com/repos/msmbuilder/msmbuilder/commits{/sha}","git_commits_url":"https://api.github.com/repos/msmbuilder/msmbuilder/git/commits{/sha}","comments_url":"https://api.github.com/repos/msmbuilder/msmbuilder/comments{/number}","issue_comment_url":"https://api.github.com/repos/msmbuilder/msmbuilder/issues/comments{/number}","contents_url":"https://api.github.com/repos/msmbuilder/msmbuilder/contents/{+path}","compare_url":"https://api.github.com/repos/msmbuilder/msmbuilder/compare/{base}...{head}","merges_url":"https://api.github.com/repos/msmbuilder/msmbuilder/merges","archive_url":"https://api.github.com/repos/msmbuilder/msmbuilder/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/msmbuilder/msmbuilder/downloads","issues_url":"https://api.github.com/repos/msmbuilder/msmbuilder/issues{/number}","pulls_url":"https://api.github.com/repos/msmbuilder/msmbuilder/pulls{/number}","milestones_url":"https://api.github.com/repos/msmbuilder/msmbuilder/milestones{/number}","notifications_url":"https://api.github.com/repos/msmbuilder/msmbuilder/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/msmbuilder/msmbuilder/labels{/name}","releases_url":"https://api.github.com/repos/msmbuilder/msmbuilder/releases{/id}","deployments_url":"https://api.github.com/repos/msmbuilder/msmbuilder/deployments","created_at":"2013-10-11T21:42:18Z","updated_at":"2016-02-15T08:20:58Z","pushed_at":"2016-03-23T23:11:37Z","git_url":"git://github.com/msmbuilder/msmbuilder.git","ssh_url":"git@github.com:msmbuilder/msmbuilder.git","clone_url":"https://github.com/msmbuilder/msmbuilder.git","svn_url":"https://github.com/msmbuilder/msmbuilder","homepage":"http://msmbuilder.org","size":27981,"stargazers_count":35,"watchers_count":35,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":41,"forks":27,"open_issues":41,"watchers":35,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/msmbuilder/msmbuilder/pulls/770"},"html":{"href":"https://github.com/msmbuilder/msmbuilder/pull/770"},"issue":{"href":"https://api.github.com/repos/msmbuilder/msmbuilder/issues/770"},"comments":{"href":"https://api.github.com/repos/msmbuilder/msmbuilder/issues/770/comments"},"review_comments":{"href":"https://api.github.com/repos/msmbuilder/msmbuilder/pulls/770/comments"},"review_comment":{"href":"https://api.github.com/repos/msmbuilder/msmbuilder/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/msmbuilder/msmbuilder/pulls/770/commits"},"statuses":{"href":"https://api.github.com/repos/msmbuilder/msmbuilder/statuses/23d11bbdf947dec7ea61d218a54b9d4b9d7c8163"}}}}