{"action":"created","comment":{"url":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments/34937771","id":34937771,"diff_hunk":"@@ -0,0 +1,101 @@\n+\"\"\"\n+=============================\n+ XDAWN Decoding From MEG data\n+=============================\n+\n+ERF decoding with Xdawn. For each event type, a set of spatial Xdawn filters\n+are trained and apply on the signal. Channels are concatenated and rescaled to\n+create features vectors that will be fed into a Logistic Regression.\n+\n+References\n+----------\n+[1] Rivet, B., Souloumiac, A., Attina, V., & Gibert, G. (2009). xDAWN\n+algorithm to enhance evoked potentials: application to brain-computer\n+interface. Biomedical Engineering, IEEE Transactions on, 56(8), 2035-2043.\n+\n+[2] Rivet, B., Cecotti, H., Souloumiac, A., Maby, E., & Mattout, J. (2011,\n+August). Theoretical analysis of xDAWN algorithm: application to an\n+efficient sensor selection in a P300 BCI. In Signal Processing Conference,\n+2011 19th European (pp. 1382-1386). IEEE.\n+\"\"\"\n+# Authors: Alexandre Barachant <alexandre.barachant@gmail.com>\n+#\n+# License: BSD (3-clause)\n+\n+import numpy as np\n+import matplotlib.pyplot as plt\n+\n+from sklearn.cross_validation import StratifiedKFold\n+from sklearn.pipeline import make_pipeline\n+from sklearn.linear_model import LogisticRegression\n+from sklearn.metrics import classification_report, confusion_matrix\n+from sklearn.preprocessing import MinMaxScaler\n+\n+from mne import io, pick_types, read_events, Epochs\n+from mne.datasets import sample\n+from mne.preprocessing import Xdawn\n+from mne.decoding import ConcatenateChannels\n+\n+\n+print(__doc__)\n+\n+data_path = sample.data_path()\n+\n+###############################################################################\n+# Set parameters and read data\n+raw_fname = data_path + '/MEG/sample/sample_audvis_filt-0-40_raw.fif'\n+event_fname = data_path + '/MEG/sample/sample_audvis_filt-0-40_raw-eve.fif'\n+tmin, tmax = -0.1, 0.3\n+event_id = dict(aud_l=1, aud_r=2, vis_l=3, vis_r=4)","path":"examples/decoding/plot_decoding_xdawn_meg.py","position":50,"original_position":49,"commit_id":"fec6747ad053251f2b41b81bd16d9cfa0db5c152","original_commit_id":"c0606a14246c3d2d19d67c1bd1c5c508f93b508d","user":{"login":"mainakjas","id":3817535,"avatar_url":"https://avatars.githubusercontent.com/u/3817535?v=3","gravatar_id":"","url":"https://api.github.com/users/mainakjas","html_url":"https://github.com/mainakjas","followers_url":"https://api.github.com/users/mainakjas/followers","following_url":"https://api.github.com/users/mainakjas/following{/other_user}","gists_url":"https://api.github.com/users/mainakjas/gists{/gist_id}","starred_url":"https://api.github.com/users/mainakjas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mainakjas/subscriptions","organizations_url":"https://api.github.com/users/mainakjas/orgs","repos_url":"https://api.github.com/users/mainakjas/repos","events_url":"https://api.github.com/users/mainakjas/events{/privacy}","received_events_url":"https://api.github.com/users/mainakjas/received_events","type":"User","site_admin":false},"body":"wait, I missed something. What is 73.2% and what is 85.4% ? \r\n\r\nThe rest makes sense. So, what do you think about changing the data to EEG (actually I would vote that this is done for all our decoding examples to make it a slightly harder problem with the data we have)?","created_at":"2015-07-17T22:51:12Z","updated_at":"2015-07-17T22:51:12Z","html_url":"https://github.com/mne-tools/mne-python/pull/2296#discussion_r34937771","pull_request_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/2296","_links":{"self":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments/34937771"},"html":{"href":"https://github.com/mne-tools/mne-python/pull/2296#discussion_r34937771"},"pull_request":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/2296"}}},"pull_request":{"url":"https://api.github.com/repos/mne-tools/mne-python/pulls/2296","id":39944715,"html_url":"https://github.com/mne-tools/mne-python/pull/2296","diff_url":"https://github.com/mne-tools/mne-python/pull/2296.diff","patch_url":"https://github.com/mne-tools/mne-python/pull/2296.patch","issue_url":"https://api.github.com/repos/mne-tools/mne-python/issues/2296","number":2296,"state":"open","locked":false,"title":"MRG: Xdawn","user":{"login":"alexandrebarachant","id":2145718,"avatar_url":"https://avatars.githubusercontent.com/u/2145718?v=3","gravatar_id":"","url":"https://api.github.com/users/alexandrebarachant","html_url":"https://github.com/alexandrebarachant","followers_url":"https://api.github.com/users/alexandrebarachant/followers","following_url":"https://api.github.com/users/alexandrebarachant/following{/other_user}","gists_url":"https://api.github.com/users/alexandrebarachant/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandrebarachant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandrebarachant/subscriptions","organizations_url":"https://api.github.com/users/alexandrebarachant/orgs","repos_url":"https://api.github.com/users/alexandrebarachant/repos","events_url":"https://api.github.com/users/alexandrebarachant/events{/privacy}","received_events_url":"https://api.github.com/users/alexandrebarachant/received_events","type":"User","site_admin":false},"body":"This is the PR related to #2245.\r\n\r\nThe code for denoising is inspired from the ICA code.  \r\n\r\nUsing this [gist](https://gist.github.com/alexandrebarachant/b4d94245db162f6663f7) , you should be able to run the code.\r\n\r\nI will add tests after validation of the API\r\n\r\ntodo list : \r\n- [x] Covariance estimation and regularization through MNE\r\n- [x] Transform method\r\n- [x] Write tests\r\n- [x] Write examples (denoising and decoding)\r\n","created_at":"2015-07-14T18:09:39Z","updated_at":"2015-07-17T22:51:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"362d9e38e48a61f0e1d4883682b84a28bda5d151","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/2296/commits","review_comments_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/2296/comments","review_comment_url":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mne-tools/mne-python/issues/2296/comments","statuses_url":"https://api.github.com/repos/mne-tools/mne-python/statuses/fec6747ad053251f2b41b81bd16d9cfa0db5c152","head":{"label":"alexandrebarachant:xdawn","ref":"xdawn","sha":"fec6747ad053251f2b41b81bd16d9cfa0db5c152","user":{"login":"alexandrebarachant","id":2145718,"avatar_url":"https://avatars.githubusercontent.com/u/2145718?v=3","gravatar_id":"","url":"https://api.github.com/users/alexandrebarachant","html_url":"https://github.com/alexandrebarachant","followers_url":"https://api.github.com/users/alexandrebarachant/followers","following_url":"https://api.github.com/users/alexandrebarachant/following{/other_user}","gists_url":"https://api.github.com/users/alexandrebarachant/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandrebarachant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandrebarachant/subscriptions","organizations_url":"https://api.github.com/users/alexandrebarachant/orgs","repos_url":"https://api.github.com/users/alexandrebarachant/repos","events_url":"https://api.github.com/users/alexandrebarachant/events{/privacy}","received_events_url":"https://api.github.com/users/alexandrebarachant/received_events","type":"User","site_admin":false},"repo":{"id":27718148,"name":"mne-python","full_name":"alexandrebarachant/mne-python","owner":{"login":"alexandrebarachant","id":2145718,"avatar_url":"https://avatars.githubusercontent.com/u/2145718?v=3","gravatar_id":"","url":"https://api.github.com/users/alexandrebarachant","html_url":"https://github.com/alexandrebarachant","followers_url":"https://api.github.com/users/alexandrebarachant/followers","following_url":"https://api.github.com/users/alexandrebarachant/following{/other_user}","gists_url":"https://api.github.com/users/alexandrebarachant/gists{/gist_id}","starred_url":"https://api.github.com/users/alexandrebarachant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexandrebarachant/subscriptions","organizations_url":"https://api.github.com/users/alexandrebarachant/orgs","repos_url":"https://api.github.com/users/alexandrebarachant/repos","events_url":"https://api.github.com/users/alexandrebarachant/events{/privacy}","received_events_url":"https://api.github.com/users/alexandrebarachant/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alexandrebarachant/mne-python","description":"MNE : Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python","fork":true,"url":"https://api.github.com/repos/alexandrebarachant/mne-python","forks_url":"https://api.github.com/repos/alexandrebarachant/mne-python/forks","keys_url":"https://api.github.com/repos/alexandrebarachant/mne-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alexandrebarachant/mne-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alexandrebarachant/mne-python/teams","hooks_url":"https://api.github.com/repos/alexandrebarachant/mne-python/hooks","issue_events_url":"https://api.github.com/repos/alexandrebarachant/mne-python/issues/events{/number}","events_url":"https://api.github.com/repos/alexandrebarachant/mne-python/events","assignees_url":"https://api.github.com/repos/alexandrebarachant/mne-python/assignees{/user}","branches_url":"https://api.github.com/repos/alexandrebarachant/mne-python/branches{/branch}","tags_url":"https://api.github.com/repos/alexandrebarachant/mne-python/tags","blobs_url":"https://api.github.com/repos/alexandrebarachant/mne-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alexandrebarachant/mne-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alexandrebarachant/mne-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/alexandrebarachant/mne-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alexandrebarachant/mne-python/statuses/{sha}","languages_url":"https://api.github.com/repos/alexandrebarachant/mne-python/languages","stargazers_url":"https://api.github.com/repos/alexandrebarachant/mne-python/stargazers","contributors_url":"https://api.github.com/repos/alexandrebarachant/mne-python/contributors","subscribers_url":"https://api.github.com/repos/alexandrebarachant/mne-python/subscribers","subscription_url":"https://api.github.com/repos/alexandrebarachant/mne-python/subscription","commits_url":"https://api.github.com/repos/alexandrebarachant/mne-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/alexandrebarachant/mne-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/alexandrebarachant/mne-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/alexandrebarachant/mne-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/alexandrebarachant/mne-python/contents/{+path}","compare_url":"https://api.github.com/repos/alexandrebarachant/mne-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alexandrebarachant/mne-python/merges","archive_url":"https://api.github.com/repos/alexandrebarachant/mne-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alexandrebarachant/mne-python/downloads","issues_url":"https://api.github.com/repos/alexandrebarachant/mne-python/issues{/number}","pulls_url":"https://api.github.com/repos/alexandrebarachant/mne-python/pulls{/number}","milestones_url":"https://api.github.com/repos/alexandrebarachant/mne-python/milestones{/number}","notifications_url":"https://api.github.com/repos/alexandrebarachant/mne-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alexandrebarachant/mne-python/labels{/name}","releases_url":"https://api.github.com/repos/alexandrebarachant/mne-python/releases{/id}","created_at":"2014-12-08T14:17:33Z","updated_at":"2014-12-08T14:17:36Z","pushed_at":"2015-07-17T20:59:24Z","git_url":"git://github.com/alexandrebarachant/mne-python.git","ssh_url":"git@github.com:alexandrebarachant/mne-python.git","clone_url":"https://github.com/alexandrebarachant/mne-python.git","svn_url":"https://github.com/alexandrebarachant/mne-python","homepage":"http://martinos.org/mne/","size":87877,"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":"mne-tools:master","ref":"master","sha":"ea33a85243188b6a20128f8b108263f8390f3115","user":{"login":"mne-tools","id":583875,"avatar_url":"https://avatars.githubusercontent.com/u/583875?v=3","gravatar_id":"","url":"https://api.github.com/users/mne-tools","html_url":"https://github.com/mne-tools","followers_url":"https://api.github.com/users/mne-tools/followers","following_url":"https://api.github.com/users/mne-tools/following{/other_user}","gists_url":"https://api.github.com/users/mne-tools/gists{/gist_id}","starred_url":"https://api.github.com/users/mne-tools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mne-tools/subscriptions","organizations_url":"https://api.github.com/users/mne-tools/orgs","repos_url":"https://api.github.com/users/mne-tools/repos","events_url":"https://api.github.com/users/mne-tools/events{/privacy}","received_events_url":"https://api.github.com/users/mne-tools/received_events","type":"Organization","site_admin":false},"repo":{"id":1301584,"name":"mne-python","full_name":"mne-tools/mne-python","owner":{"login":"mne-tools","id":583875,"avatar_url":"https://avatars.githubusercontent.com/u/583875?v=3","gravatar_id":"","url":"https://api.github.com/users/mne-tools","html_url":"https://github.com/mne-tools","followers_url":"https://api.github.com/users/mne-tools/followers","following_url":"https://api.github.com/users/mne-tools/following{/other_user}","gists_url":"https://api.github.com/users/mne-tools/gists{/gist_id}","starred_url":"https://api.github.com/users/mne-tools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mne-tools/subscriptions","organizations_url":"https://api.github.com/users/mne-tools/orgs","repos_url":"https://api.github.com/users/mne-tools/repos","events_url":"https://api.github.com/users/mne-tools/events{/privacy}","received_events_url":"https://api.github.com/users/mne-tools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mne-tools/mne-python","description":"MNE : Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python","fork":false,"url":"https://api.github.com/repos/mne-tools/mne-python","forks_url":"https://api.github.com/repos/mne-tools/mne-python/forks","keys_url":"https://api.github.com/repos/mne-tools/mne-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mne-tools/mne-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mne-tools/mne-python/teams","hooks_url":"https://api.github.com/repos/mne-tools/mne-python/hooks","issue_events_url":"https://api.github.com/repos/mne-tools/mne-python/issues/events{/number}","events_url":"https://api.github.com/repos/mne-tools/mne-python/events","assignees_url":"https://api.github.com/repos/mne-tools/mne-python/assignees{/user}","branches_url":"https://api.github.com/repos/mne-tools/mne-python/branches{/branch}","tags_url":"https://api.github.com/repos/mne-tools/mne-python/tags","blobs_url":"https://api.github.com/repos/mne-tools/mne-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mne-tools/mne-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mne-tools/mne-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/mne-tools/mne-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mne-tools/mne-python/statuses/{sha}","languages_url":"https://api.github.com/repos/mne-tools/mne-python/languages","stargazers_url":"https://api.github.com/repos/mne-tools/mne-python/stargazers","contributors_url":"https://api.github.com/repos/mne-tools/mne-python/contributors","subscribers_url":"https://api.github.com/repos/mne-tools/mne-python/subscribers","subscription_url":"https://api.github.com/repos/mne-tools/mne-python/subscription","commits_url":"https://api.github.com/repos/mne-tools/mne-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/mne-tools/mne-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/mne-tools/mne-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/mne-tools/mne-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/mne-tools/mne-python/contents/{+path}","compare_url":"https://api.github.com/repos/mne-tools/mne-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mne-tools/mne-python/merges","archive_url":"https://api.github.com/repos/mne-tools/mne-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mne-tools/mne-python/downloads","issues_url":"https://api.github.com/repos/mne-tools/mne-python/issues{/number}","pulls_url":"https://api.github.com/repos/mne-tools/mne-python/pulls{/number}","milestones_url":"https://api.github.com/repos/mne-tools/mne-python/milestones{/number}","notifications_url":"https://api.github.com/repos/mne-tools/mne-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mne-tools/mne-python/labels{/name}","releases_url":"https://api.github.com/repos/mne-tools/mne-python/releases{/id}","created_at":"2011-01-28T03:31:13Z","updated_at":"2015-07-10T19:14:50Z","pushed_at":"2015-07-17T22:43:56Z","git_url":"git://github.com/mne-tools/mne-python.git","ssh_url":"git@github.com:mne-tools/mne-python.git","clone_url":"https://github.com/mne-tools/mne-python.git","svn_url":"https://github.com/mne-tools/mne-python","homepage":"http://martinos.org/mne/","size":181260,"stargazers_count":138,"watchers_count":138,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":130,"mirror_url":null,"open_issues_count":187,"forks":130,"open_issues":187,"watchers":138,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/2296"},"html":{"href":"https://github.com/mne-tools/mne-python/pull/2296"},"issue":{"href":"https://api.github.com/repos/mne-tools/mne-python/issues/2296"},"comments":{"href":"https://api.github.com/repos/mne-tools/mne-python/issues/2296/comments"},"review_comments":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/2296/comments"},"review_comment":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mne-tools/mne-python/pulls/2296/commits"},"statuses":{"href":"https://api.github.com/repos/mne-tools/mne-python/statuses/fec6747ad053251f2b41b81bd16d9cfa0db5c152"}}}}