{"action":"created","comment":{"url":"https://api.github.com/repos/PyMVPA/PyMVPA/pulls/comments/53722014","id":53722014,"diff_hunk":"@@ -0,0 +1,476 @@\n+# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n+# vi: set ft=python sts=4 ts=4 sw=4 et:\n+### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##\n+#\n+#   See COPYING file distributed along with the PyMVPA package for the\n+#   copyright and license terms.\n+#\n+### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##\n+\"\"\"Searchlight-based hyperalignment\"\"\"\n+import numpy as np\n+from mvpa2.base.state import ClassWithCollections\n+from mvpa2.base.param import Parameter\n+from mvpa2.algorithms.hyperalignment import Hyperalignment\n+from mvpa2.measures.base import Measure\n+from mvpa2.datasets import Dataset, vstack\n+from mvpa2.mappers.staticprojection import StaticProjectionMapper\n+from scipy.linalg import LinAlgError\n+from mvpa2.measures.searchlight import sphere_searchlight\n+from mvpa2.mappers.zscore import zscore\n+from scipy.sparse import coo_matrix, dok_matrix, csc_matrix\n+from mvpa2.featsel.helpers import FractionTailSelector, FixedNElementTailSelector\n+\n+if __debug__:\n+    from mvpa2.base import debug\n+\n+def compute_feature_scores(datasets, exclude_from_model=None):\n+    \"\"\"\n+    Takes a list of datasets and computes a magical feature\n+    score for each feature in each dataset\n+    :ref:`Haxby et al., Neuron (2011) <HGC+11>`\n+    Parameters\n+    ----------","path":"mvpa2/algorithms/searchlight_hyperalignment.py","position":32,"original_position":32,"commit_id":"f7585a81f4dfa64784b14e29aa726a4d03e447a2","original_commit_id":"f7585a81f4dfa64784b14e29aa726a4d03e447a2","user":{"login":"yarikoptic","id":39889,"avatar_url":"https://avatars.githubusercontent.com/u/39889?v=3","gravatar_id":"","url":"https://api.github.com/users/yarikoptic","html_url":"https://github.com/yarikoptic","followers_url":"https://api.github.com/users/yarikoptic/followers","following_url":"https://api.github.com/users/yarikoptic/following{/other_user}","gists_url":"https://api.github.com/users/yarikoptic/gists{/gist_id}","starred_url":"https://api.github.com/users/yarikoptic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarikoptic/subscriptions","organizations_url":"https://api.github.com/users/yarikoptic/orgs","repos_url":"https://api.github.com/users/yarikoptic/repos","events_url":"https://api.github.com/users/yarikoptic/events{/privacy}","received_events_url":"https://api.github.com/users/yarikoptic/received_events","type":"User","site_admin":false},"body":"empty line before Parameters, no indentation is needed for those below","created_at":"2016-02-23T01:05:37Z","updated_at":"2016-02-23T01:05:37Z","html_url":"https://github.com/PyMVPA/PyMVPA/pull/429#discussion_r53722014","pull_request_url":"https://api.github.com/repos/PyMVPA/PyMVPA/pulls/429","_links":{"self":{"href":"https://api.github.com/repos/PyMVPA/PyMVPA/pulls/comments/53722014"},"html":{"href":"https://github.com/PyMVPA/PyMVPA/pull/429#discussion_r53722014"},"pull_request":{"href":"https://api.github.com/repos/PyMVPA/PyMVPA/pulls/429"}}},"pull_request":{"url":"https://api.github.com/repos/PyMVPA/PyMVPA/pulls/429","id":60243431,"html_url":"https://github.com/PyMVPA/PyMVPA/pull/429","diff_url":"https://github.com/PyMVPA/PyMVPA/pull/429.diff","patch_url":"https://github.com/PyMVPA/PyMVPA/pull/429.patch","issue_url":"https://api.github.com/repos/PyMVPA/PyMVPA/issues/429","number":429,"state":"open","locked":false,"title":"NF: Adding SearchlightHyperalignment","user":{"login":"swaroopgj","id":139211,"avatar_url":"https://avatars.githubusercontent.com/u/139211?v=3","gravatar_id":"","url":"https://api.github.com/users/swaroopgj","html_url":"https://github.com/swaroopgj","followers_url":"https://api.github.com/users/swaroopgj/followers","following_url":"https://api.github.com/users/swaroopgj/following{/other_user}","gists_url":"https://api.github.com/users/swaroopgj/gists{/gist_id}","starred_url":"https://api.github.com/users/swaroopgj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swaroopgj/subscriptions","organizations_url":"https://api.github.com/users/swaroopgj/orgs","repos_url":"https://api.github.com/users/swaroopgj/repos","events_url":"https://api.github.com/users/swaroopgj/events{/privacy}","received_events_url":"https://api.github.com/users/swaroopgj/received_events","type":"User","site_admin":false},"body":"Basic pieces for Searchlight Hyperalignment as described in [1].\r\nIt can be done using volume searchlights or surface searchlight discs if surfaces are available.\r\n\r\n1. Guntupalli et al.  A Model of Representational Spaces in Human Cortex. Cerebral Cortex, in press.","created_at":"2016-02-22T21:25:40Z","updated_at":"2016-02-23T01:05:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"37deaf429d6b174c7ba7b39d831722b1a3dcb6fd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/PyMVPA/PyMVPA/pulls/429/commits","review_comments_url":"https://api.github.com/repos/PyMVPA/PyMVPA/pulls/429/comments","review_comment_url":"https://api.github.com/repos/PyMVPA/PyMVPA/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PyMVPA/PyMVPA/issues/429/comments","statuses_url":"https://api.github.com/repos/PyMVPA/PyMVPA/statuses/f7585a81f4dfa64784b14e29aa726a4d03e447a2","head":{"label":"swaroopgj:slhyper","ref":"slhyper","sha":"f7585a81f4dfa64784b14e29aa726a4d03e447a2","user":{"login":"swaroopgj","id":139211,"avatar_url":"https://avatars.githubusercontent.com/u/139211?v=3","gravatar_id":"","url":"https://api.github.com/users/swaroopgj","html_url":"https://github.com/swaroopgj","followers_url":"https://api.github.com/users/swaroopgj/followers","following_url":"https://api.github.com/users/swaroopgj/following{/other_user}","gists_url":"https://api.github.com/users/swaroopgj/gists{/gist_id}","starred_url":"https://api.github.com/users/swaroopgj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swaroopgj/subscriptions","organizations_url":"https://api.github.com/users/swaroopgj/orgs","repos_url":"https://api.github.com/users/swaroopgj/repos","events_url":"https://api.github.com/users/swaroopgj/events{/privacy}","received_events_url":"https://api.github.com/users/swaroopgj/received_events","type":"User","site_admin":false},"repo":{"id":336044,"name":"PyMVPA","full_name":"swaroopgj/PyMVPA","owner":{"login":"swaroopgj","id":139211,"avatar_url":"https://avatars.githubusercontent.com/u/139211?v=3","gravatar_id":"","url":"https://api.github.com/users/swaroopgj","html_url":"https://github.com/swaroopgj","followers_url":"https://api.github.com/users/swaroopgj/followers","following_url":"https://api.github.com/users/swaroopgj/following{/other_user}","gists_url":"https://api.github.com/users/swaroopgj/gists{/gist_id}","starred_url":"https://api.github.com/users/swaroopgj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swaroopgj/subscriptions","organizations_url":"https://api.github.com/users/swaroopgj/orgs","repos_url":"https://api.github.com/users/swaroopgj/repos","events_url":"https://api.github.com/users/swaroopgj/events{/privacy}","received_events_url":"https://api.github.com/users/swaroopgj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/swaroopgj/PyMVPA","description":"multivariate pattern analysis in Python","fork":true,"url":"https://api.github.com/repos/swaroopgj/PyMVPA","forks_url":"https://api.github.com/repos/swaroopgj/PyMVPA/forks","keys_url":"https://api.github.com/repos/swaroopgj/PyMVPA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/swaroopgj/PyMVPA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/swaroopgj/PyMVPA/teams","hooks_url":"https://api.github.com/repos/swaroopgj/PyMVPA/hooks","issue_events_url":"https://api.github.com/repos/swaroopgj/PyMVPA/issues/events{/number}","events_url":"https://api.github.com/repos/swaroopgj/PyMVPA/events","assignees_url":"https://api.github.com/repos/swaroopgj/PyMVPA/assignees{/user}","branches_url":"https://api.github.com/repos/swaroopgj/PyMVPA/branches{/branch}","tags_url":"https://api.github.com/repos/swaroopgj/PyMVPA/tags","blobs_url":"https://api.github.com/repos/swaroopgj/PyMVPA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/swaroopgj/PyMVPA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/swaroopgj/PyMVPA/git/refs{/sha}","trees_url":"https://api.github.com/repos/swaroopgj/PyMVPA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/swaroopgj/PyMVPA/statuses/{sha}","languages_url":"https://api.github.com/repos/swaroopgj/PyMVPA/languages","stargazers_url":"https://api.github.com/repos/swaroopgj/PyMVPA/stargazers","contributors_url":"https://api.github.com/repos/swaroopgj/PyMVPA/contributors","subscribers_url":"https://api.github.com/repos/swaroopgj/PyMVPA/subscribers","subscription_url":"https://api.github.com/repos/swaroopgj/PyMVPA/subscription","commits_url":"https://api.github.com/repos/swaroopgj/PyMVPA/commits{/sha}","git_commits_url":"https://api.github.com/repos/swaroopgj/PyMVPA/git/commits{/sha}","comments_url":"https://api.github.com/repos/swaroopgj/PyMVPA/comments{/number}","issue_comment_url":"https://api.github.com/repos/swaroopgj/PyMVPA/issues/comments{/number}","contents_url":"https://api.github.com/repos/swaroopgj/PyMVPA/contents/{+path}","compare_url":"https://api.github.com/repos/swaroopgj/PyMVPA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/swaroopgj/PyMVPA/merges","archive_url":"https://api.github.com/repos/swaroopgj/PyMVPA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/swaroopgj/PyMVPA/downloads","issues_url":"https://api.github.com/repos/swaroopgj/PyMVPA/issues{/number}","pulls_url":"https://api.github.com/repos/swaroopgj/PyMVPA/pulls{/number}","milestones_url":"https://api.github.com/repos/swaroopgj/PyMVPA/milestones{/number}","notifications_url":"https://api.github.com/repos/swaroopgj/PyMVPA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/swaroopgj/PyMVPA/labels{/name}","releases_url":"https://api.github.com/repos/swaroopgj/PyMVPA/releases{/id}","deployments_url":"https://api.github.com/repos/swaroopgj/PyMVPA/deployments","created_at":"2009-10-13T15:16:13Z","updated_at":"2015-02-23T20:01:22Z","pushed_at":"2016-02-22T21:58:51Z","git_url":"git://github.com/swaroopgj/PyMVPA.git","ssh_url":"git@github.com:swaroopgj/PyMVPA.git","clone_url":"https://github.com/swaroopgj/PyMVPA.git","svn_url":"https://github.com/swaroopgj/PyMVPA","homepage":"http://www.pymvpa.org","size":25215,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"PyMVPA:master","ref":"master","sha":"6390bc6223b3d2cf18dde2151941535afebe8fd2","user":{"login":"PyMVPA","id":341117,"avatar_url":"https://avatars.githubusercontent.com/u/341117?v=3","gravatar_id":"","url":"https://api.github.com/users/PyMVPA","html_url":"https://github.com/PyMVPA","followers_url":"https://api.github.com/users/PyMVPA/followers","following_url":"https://api.github.com/users/PyMVPA/following{/other_user}","gists_url":"https://api.github.com/users/PyMVPA/gists{/gist_id}","starred_url":"https://api.github.com/users/PyMVPA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PyMVPA/subscriptions","organizations_url":"https://api.github.com/users/PyMVPA/orgs","repos_url":"https://api.github.com/users/PyMVPA/repos","events_url":"https://api.github.com/users/PyMVPA/events{/privacy}","received_events_url":"https://api.github.com/users/PyMVPA/received_events","type":"Organization","site_admin":false},"repo":{"id":330077,"name":"PyMVPA","full_name":"PyMVPA/PyMVPA","owner":{"login":"PyMVPA","id":341117,"avatar_url":"https://avatars.githubusercontent.com/u/341117?v=3","gravatar_id":"","url":"https://api.github.com/users/PyMVPA","html_url":"https://github.com/PyMVPA","followers_url":"https://api.github.com/users/PyMVPA/followers","following_url":"https://api.github.com/users/PyMVPA/following{/other_user}","gists_url":"https://api.github.com/users/PyMVPA/gists{/gist_id}","starred_url":"https://api.github.com/users/PyMVPA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PyMVPA/subscriptions","organizations_url":"https://api.github.com/users/PyMVPA/orgs","repos_url":"https://api.github.com/users/PyMVPA/repos","events_url":"https://api.github.com/users/PyMVPA/events{/privacy}","received_events_url":"https://api.github.com/users/PyMVPA/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PyMVPA/PyMVPA","description":"MultiVariate Pattern Analysis in Python","fork":false,"url":"https://api.github.com/repos/PyMVPA/PyMVPA","forks_url":"https://api.github.com/repos/PyMVPA/PyMVPA/forks","keys_url":"https://api.github.com/repos/PyMVPA/PyMVPA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PyMVPA/PyMVPA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PyMVPA/PyMVPA/teams","hooks_url":"https://api.github.com/repos/PyMVPA/PyMVPA/hooks","issue_events_url":"https://api.github.com/repos/PyMVPA/PyMVPA/issues/events{/number}","events_url":"https://api.github.com/repos/PyMVPA/PyMVPA/events","assignees_url":"https://api.github.com/repos/PyMVPA/PyMVPA/assignees{/user}","branches_url":"https://api.github.com/repos/PyMVPA/PyMVPA/branches{/branch}","tags_url":"https://api.github.com/repos/PyMVPA/PyMVPA/tags","blobs_url":"https://api.github.com/repos/PyMVPA/PyMVPA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PyMVPA/PyMVPA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PyMVPA/PyMVPA/git/refs{/sha}","trees_url":"https://api.github.com/repos/PyMVPA/PyMVPA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PyMVPA/PyMVPA/statuses/{sha}","languages_url":"https://api.github.com/repos/PyMVPA/PyMVPA/languages","stargazers_url":"https://api.github.com/repos/PyMVPA/PyMVPA/stargazers","contributors_url":"https://api.github.com/repos/PyMVPA/PyMVPA/contributors","subscribers_url":"https://api.github.com/repos/PyMVPA/PyMVPA/subscribers","subscription_url":"https://api.github.com/repos/PyMVPA/PyMVPA/subscription","commits_url":"https://api.github.com/repos/PyMVPA/PyMVPA/commits{/sha}","git_commits_url":"https://api.github.com/repos/PyMVPA/PyMVPA/git/commits{/sha}","comments_url":"https://api.github.com/repos/PyMVPA/PyMVPA/comments{/number}","issue_comment_url":"https://api.github.com/repos/PyMVPA/PyMVPA/issues/comments{/number}","contents_url":"https://api.github.com/repos/PyMVPA/PyMVPA/contents/{+path}","compare_url":"https://api.github.com/repos/PyMVPA/PyMVPA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PyMVPA/PyMVPA/merges","archive_url":"https://api.github.com/repos/PyMVPA/PyMVPA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PyMVPA/PyMVPA/downloads","issues_url":"https://api.github.com/repos/PyMVPA/PyMVPA/issues{/number}","pulls_url":"https://api.github.com/repos/PyMVPA/PyMVPA/pulls{/number}","milestones_url":"https://api.github.com/repos/PyMVPA/PyMVPA/milestones{/number}","notifications_url":"https://api.github.com/repos/PyMVPA/PyMVPA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PyMVPA/PyMVPA/labels{/name}","releases_url":"https://api.github.com/repos/PyMVPA/PyMVPA/releases{/id}","deployments_url":"https://api.github.com/repos/PyMVPA/PyMVPA/deployments","created_at":"2009-10-07T18:57:13Z","updated_at":"2016-02-22T19:58:54Z","pushed_at":"2016-02-22T21:58:51Z","git_url":"git://github.com/PyMVPA/PyMVPA.git","ssh_url":"git@github.com:PyMVPA/PyMVPA.git","clone_url":"https://github.com/PyMVPA/PyMVPA.git","svn_url":"https://github.com/PyMVPA/PyMVPA","homepage":"http://www.pymvpa.org","size":26154,"stargazers_count":119,"watchers_count":119,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":66,"mirror_url":null,"open_issues_count":83,"forks":66,"open_issues":83,"watchers":119,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PyMVPA/PyMVPA/pulls/429"},"html":{"href":"https://github.com/PyMVPA/PyMVPA/pull/429"},"issue":{"href":"https://api.github.com/repos/PyMVPA/PyMVPA/issues/429"},"comments":{"href":"https://api.github.com/repos/PyMVPA/PyMVPA/issues/429/comments"},"review_comments":{"href":"https://api.github.com/repos/PyMVPA/PyMVPA/pulls/429/comments"},"review_comment":{"href":"https://api.github.com/repos/PyMVPA/PyMVPA/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PyMVPA/PyMVPA/pulls/429/commits"},"statuses":{"href":"https://api.github.com/repos/PyMVPA/PyMVPA/statuses/f7585a81f4dfa64784b14e29aa726a4d03e447a2"}}}}