<p><span style="padding: 3px 10px; border-radius: 5px; color: #ffffff; font-weight: bold; display: inline-block; background-color: #ff0000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;External Email - Use Caution&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p><p></p><div>What you're showing is the output of the plot_opm_data.py example script.&nbsp; What I suggested was to re-install MNE-Python and its dependencies and examine the output of *the reinstallation process*, not the output of the example script.&nbsp; Did you do that?&nbsp; What (if any) errors did you see during reinstallation?&nbsp; How did you do the reinstallation (pip, conda, something else)?&nbsp; Did you search for problems related to matplotlib and ft2font?&nbsp; What does mne.sys_info() tell you?<br></div><div><br></div><div class="protonmail_signature_block"><div class="protonmail_signature_block-user"><div>-- dan<br></div><div>Daniel McCloy<br></div><div>https://dan.mccloy.info<br></div><div>Research Scientist<br></div><div>Institute for Learning and Brain Sciences<br></div><div>University of Washington<br></div></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"><br></div></div><div><br></div><div>‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐<br></div><div> On Saturday, April 4, 2020 7:21 PM, Saeed Zahran &lt;saeedzahran@hotmail.com&gt; wrote:<br></div><div> <br></div><blockquote class="protonmail_quote" type="cite"><p><span style="background-color:rgb(255, 0, 0)"><span style="color:rgb(255, 255, 255)"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;External Email - Use Caution&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></span></span><br></p><p><br></p><div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);"><span>Thank you Dan for your reply, I did exactly what you recommended, still have the below error:</span><br></div><div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);"><span></span><br></div><div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);"><div><span>C:\Users\zahransa\anaconda3\python.exe C:/Users/zahransa/PycharmProjects/opm/plot_opm_data.py<br> </span> </div><div>Opening raw data file C:\Users\zahransa\mne_data\MNE-OPM-data\MEG\OPM\OPM_SEF_raw.fif...<br></div><div>Isotrak not found<br></div><div>&nbsp; &nbsp; Range : 0 ... 700999 = &nbsp; &nbsp; &nbsp;0.000 ... &nbsp; 700.999 secs<br></div><div>Ready.<br></div><div>Current compensation grade : 0<br></div><div>Reading 0 ... 700999 &nbsp;= &nbsp; &nbsp; &nbsp;0.000 ... &nbsp; 700.999 secs...<br></div><div>Filtering raw data in 1 contiguous segment<br></div><div>Setting up low-pass filter at 90 Hz<br></div><div><br></div><div>FIR filter parameters<br></div><div>---------------------<br></div><div>Designing a one-pass, zero-phase, non-causal lowpass filter:<br></div><div>- Windowed time-domain design (firwin) method<br></div><div>- Hamming window with 0.0194 passband ripple and 53 dB stopband attenuation<br></div><div>- Upper passband edge: 90.00 Hz<br></div><div>- Upper transition bandwidth: 10.00 Hz (-6 dB cutoff frequency: 95.00 Hz)<br></div><div>- Filter length: 331 samples (0.331 sec)<br></div><div><br></div><div>Setting up band-stop filter from 49 - 51 Hz<br></div><div><br></div><div>FIR filter parameters<br></div><div>---------------------<br></div><div>Designing a one-pass, zero-phase, non-causal bandstop filter:<br></div><div>- Windowed time-domain design (firwin) method<br></div><div>- Hamming window with 0.0194 passband ripple and 53 dB stopband attenuation<br></div><div>- Lower passband edge: 49.00<br></div><div>- Lower transition bandwidth: 0.50 Hz (-6 dB cutoff frequency: 48.75 Hz)<br></div><div>- Upper passband edge: 51.00 Hz<br></div><div>- Upper transition bandwidth: 0.50 Hz (-6 dB cutoff frequency: 51.25 Hz)<br></div><div>- Filter length: 6601 samples (6.601 sec)<br></div><div><br></div><div>Trigger channel has a non-zero initial value of 256 (consider using initial_event=True to detect this event)<br></div><div>201 events found<br></div><div>Event IDs: [257]<br></div><div>Traceback (most recent call last):<br></div><div>&nbsp; File "C:/Users/zahransa/PycharmProjects/opm/plot_opm_data.py", line 51, in &lt;module&gt;<br></div><div>&nbsp; &nbsp; evoked.plot()<br></div><div>&nbsp; File "C:\Users\zahransa\anaconda3\lib\site-packages\mne\evoked.py", line 293, in plot<br></div><div>&nbsp; &nbsp; time_unit=time_unit, sphere=sphere, verbose=verbose)<br></div><div>&nbsp; File "&lt;decorator-gen-134&gt;", line 21, in plot_evoked<br></div><div>&nbsp; File "C:\Users\zahransa\anaconda3\lib\site-packages\mne\viz\evoked.py", line 733, in plot_evoked<br></div><div>&nbsp; &nbsp; time_unit=time_unit, sphere=sphere)<br></div><div>&nbsp; File "C:\Users\zahransa\anaconda3\lib\site-packages\mne\viz\evoked.py", line 208, in _plot_evoked<br></div><div>&nbsp; &nbsp; import matplotlib.pyplot as plt<br></div><div>&nbsp; File "C:\Users\zahransa\anaconda3\lib\site-packages\matplotlib\pyplot.py", line 2282, in &lt;module&gt;<br></div><div>&nbsp; &nbsp; switch_backend(rcParams["backend"])<br></div><div>&nbsp; File "C:\Users\zahransa\anaconda3\lib\site-packages\matplotlib\pyplot.py", line 221, in switch_backend<br></div><div>&nbsp; &nbsp; backend_mod = importlib.import_module(backend_name)<br></div><div>&nbsp; File "C:\Users\zahransa\anaconda3\lib\importlib\__init__.py", line 127, in import_module<br></div><div>&nbsp; &nbsp; return _bootstrap._gcd_import(name[level:], package, level)<br></div><div>&nbsp; File "C:\Users\zahransa\anaconda3\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 2, in &lt;module&gt;<br></div><div>&nbsp; &nbsp; from .backend_agg import FigureCanvasAgg<br></div><div>&nbsp; File "C:\Users\zahransa\anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py", line 50, in &lt;module&gt;<br></div><div>&nbsp; &nbsp; from PIL import Image<br></div><div>&nbsp; File "C:\Users\zahransa\anaconda3\lib\site-packages\PIL\Image.py", line 69, in &lt;module&gt;<br></div><div>&nbsp; &nbsp; from . import _imaging as core<br></div><div>ImportError: DLL load failed: Le module spécifié est introuvable.<br></div><div><br></div><div><span>Process finished with exit code 1</span><br></div></div><div><br></div><div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br></div><div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)"><br></div><div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">Best regards<br></div><div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">Saeed<br></div><div><hr tabindex="-1" style="display:inline-block; width:98%"><br></div><div dir="ltr"><div><span style="font-family:Calibri, sans-serif"><span style="color:#000000"><b>From:</b> mne_analysis-bounces@nmr.mgh.harvard.edu &lt;mne_analysis-bounces@nmr.mgh.harvard.edu&gt; on behalf of mne_analysis-request@nmr.mgh.harvard.edu
 &lt;mne_analysis-request@nmr.mgh.harvard.edu&gt;<br> <b>Sent:</b> Sunday, April 5, 2020 1:01 AM<br> <b>To:</b> mne_analysis@nmr.mgh.harvard.edu &lt;mne_analysis@nmr.mgh.harvard.edu&gt;<br> <b>Subject:</b> Mne_analysis Digest, Vol 147, Issue 12</span></span> </div><div>&nbsp;<br></div></div><div><span style="font-size:13px"><span style="font-size:11pt"><div><div>Send Mne_analysis mailing list submissions to<br></div><div> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mne_analysis@nmr.mgh.harvard.edu<br></div><div> <br></div><div> To subscribe or unsubscribe via the World Wide Web, visit<br></div><div> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis"> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br></div><div> or, via email, send a message with subject or body 'help' to<br></div><div> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mne_analysis-request@nmr.mgh.harvard.edu<br></div><div> <br></div><div> You can reach the person managing the list at<br></div><div> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mne_analysis-owner@nmr.mgh.harvard.edu<br></div><div> <br></div><div> When replying, please edit your Subject line so it is more specific<br></div><div> than "Re: Contents of Mne_analysis digest..."<br></div><div> <br></div><div> <br></div><div> Today's Topics:<br></div><div> <br></div><div> &nbsp;&nbsp; 1. Re: Starting with mne (Dan McCloy)<br></div><div> <br></div><div> <br></div><div> ----------------------------------------------------------------------<br></div><div> <br></div><div> Message: 1<br></div><div> Date: Sat, 04 Apr 2020 22:01:18 +0000<br></div><div> From: Dan McCloy &lt;dan@mccloy.info&gt;<br></div><div> Subject: Re: [Mne_analysis] Starting with mne<br></div><div> To: Discussion and support forum for the users of MNE Software<br></div><div> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;mne_analysis@nmr.mgh.harvard.edu&gt;<br></div><div> Message-ID:<br></div><div> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Mv3TQbne75xhJSyRzIgJ5quw5vT64yrnPlgIilmPnClYppFBc-euEZ-alrg_0xGzNzxz2FkHHpkLgMf-JhvR1lyjJJ_DshC7BidCvKzslew=@mccloy.info&gt;<br></div><div> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br></div><div> Content-Type: text/plain; charset="utf-8"<br></div><div> <br></div><div> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; External Email - Use Caution&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br></div><div> <br></div><div> The OPM data are public, and will be automatically downloaded to (by default) $HOME/mne_data/ when you call `mne.datasets.opm.data_path()` for the first time. That function will return the full path to the download location.&nbsp; Can you try running just that line
 directly in the python interpreter, rather than running the whole script?&nbsp; There are some reports that URLlib might behave differently in those two conditions (e.g., [here](https://stackoverflow.com/q/27115803/1664024)).<br></div><div> <br></div><div> The other error looks like an error loading matplotlib, and suggests there was some installation problem (specifically with the ft2font dependency). See [here](https://stackoverflow.com/q/24251102/1664024). If I were in this situation I would probably just
 start over reinstalling MNE-Python, pay close attention to any warnings / errors that occur during installation, and then copy/paste those warnings/errors into a search engine. If that doesn't lead you to a solution, you can of course ask again here.<br></div><div> <br></div><div> -- dan<br></div><div> Daniel McCloy<br></div><div> <a href="https://dan.mccloy.info">https://dan.mccloy.info</a><br></div><div> Research Scientist<br></div><div> Institute for Learning and Brain Sciences<br></div><div> University of Washington<br></div><div> <br></div><div> ??????? Original Message ???????<br></div><div> On Saturday, April 4, 2020 2:38 PM, Saeed Zahran &lt;saeedzahran@hotmail.com&gt; wrote:<br></div><div> <br></div><div> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; External Email - Use Caution<br></div><div> &gt;<br></div><div> &gt; Dear All,<br></div><div> &gt;<br></div><div> &gt; I hope you are fine and in good health,<br></div><div> &gt;<br></div><div> &gt; I am starting a new project, and I would like to use MNE,<br></div><div> &gt; I would like to compare OPM-MEG to SQUID MEG,<br></div><div> &gt; I know mne from past, but this is the first time that I want to install it and use it,<br></div><div> &gt;<br></div><div> &gt; I saw that mne deal with OPM like:<br></div><div> &gt;<br></div><div> &gt; <a href="https://mne.tools/dev/auto_examples/time_frequency/plot_source_power_spectrum_opm.html"> https://mne.tools/dev/auto_examples/time_frequency/plot_source_power_spectrum_opm.html</a><br></div><div> &gt;<br></div><div> &gt; I have some questions and thank you for your answering:<br></div><div> &gt;<br></div><div> &gt; 1) I would like to know if is possible to access the data, for example to look&nbsp; about how the OPM sensors are oriented,<br></div><div> &gt; in the script you put:[subject](https://docs.python.org/3/library/stdtypes.html#str) = 'OPM_sample' so does it mean the sample data are accessable?<br></div><div> &gt; it is possible to get the lead field matrix? sorry if it is simple question because<br></div><div> &gt; I try to install the mne to see what the script should give but when I run it I have some errors, so the second question:<br></div><div> &gt;<br></div><div> &gt; 2) I installed anaconda version 3.7 and pycharm and I follow this link:<br></div><div> &gt; <a href="https://mne.tools/stable/install/mne_python.html">https://mne.tools/stable/install/mne_python.html</a><br></div><div> &gt;<br></div><div> &gt; I run an example from mne, I get the below error:<br></div><div> &gt;<br></div><div> &gt; C:\Users\zahransa\anaconda3\python.exe C:/Users/zahransa/PycharmProjects/opm/plot_opm_data.py<br></div><div> &gt; Using default location ~/mne_data for opm...<br></div><div> &gt; Downloading archive MNE-OPM-data.tar.gz to C:\Users\zahransa\mne_data<br></div><div> &gt; Error while fetching file <a href="https://osf.io/p6ae7/download?version=2">https://osf.io/p6ae7/download?version=2</a>. Dataset fetching aborted.<br></div><div> &gt; Traceback (most recent call last):<br></div><div> &gt;&nbsp;&nbsp; File "C:/Users/zahransa/PycharmProjects/opm/plot_opm_data.py", line 20, in &lt;module&gt;<br></div><div> &gt;&nbsp;&nbsp;&nbsp;&nbsp; data_path = mne.datasets.opm.data_path()<br></div><div> &gt;&nbsp;&nbsp; File "&lt;decorator-gen-411&gt;", line 21, in data_path<br></div><div> &gt;&nbsp;&nbsp; File "C:\Users\zahransa\anaconda3\lib\site-packages\mne\datasets\opm\opm.py", line 21, in data_path<br></div><div> &gt;&nbsp;&nbsp;&nbsp;&nbsp; download=download)<br></div><div> &gt;&nbsp;&nbsp; File "C:\Users\zahransa\anaconda3\lib\site-packages\mne\datasets\utils.py", line 395, in _data_path<br></div><div> &gt;&nbsp;&nbsp;&nbsp;&nbsp; remove_archive, full = _download(path, u, an, h)<br></div><div> &gt;&nbsp;&nbsp; File "C:\Users\zahransa\anaconda3\lib\site-packages\mne\datasets\utils.py", line 453, in _download<br></div><div> &gt;&nbsp;&nbsp;&nbsp;&nbsp; hash_=hash_, hash_type=hash_type)<br></div><div> &gt;&nbsp;&nbsp; File "&lt;decorator-gen-3&gt;", line 21, in _fetch_file<br></div><div> &gt;&nbsp;&nbsp; File "C:\Users\zahransa\anaconda3\lib\site-packages\mne\utils\fetching.py", line 117, in _fetch_file<br></div><div> &gt;&nbsp;&nbsp;&nbsp;&nbsp; _get_http(url, temp_file_name, initial_size, timeout, verbose_bool)<br></div><div> &gt;&nbsp;&nbsp; File "C:\Users\zahransa\anaconda3\lib\site-packages\mne\utils\fetching.py", line 43, in _get_http<br></div><div> &gt;&nbsp;&nbsp;&nbsp;&nbsp; response = request.urlopen(request.Request(url), timeout=timeout)<br></div><div> &gt;&nbsp;&nbsp; File "C:\Users\zahransa\anaconda3\lib\urllib\request.py", line 222, in urlopen<br></div><div> &gt;&nbsp;&nbsp;&nbsp;&nbsp; return opener.open(url, data, timeout)<br></div><div> &gt;&nbsp;&nbsp; File "C:\Users\zahransa\anaconda3\lib\urllib\request.py", line 525, in open<br></div><div> &gt;&nbsp;&nbsp;&nbsp;&nbsp; response = self._open(req, data)<br></div><div> &gt;&nbsp;&nbsp; File "C:\Users\zahransa\anaconda3\lib\urllib\request.py", line 548, in _open<br></div><div> &gt;&nbsp;&nbsp;&nbsp;&nbsp; 'unknown_open', req)<br></div><div> &gt;&nbsp;&nbsp; File "C:\Users\zahransa\anaconda3\lib\urllib\request.py", line 503, in _call_chain<br></div><div> &gt;&nbsp;&nbsp;&nbsp;&nbsp; result = func(*args)<br></div><div> &gt;&nbsp;&nbsp; File "C:\Users\zahransa\anaconda3\lib\urllib\request.py", line 1389, in unknown_open<br></div><div> &gt;&nbsp;&nbsp;&nbsp;&nbsp; raise URLError('unknown url type: %s' % type)<br></div><div> &gt; urllib.error.URLError: &lt;urlopen error unknown url type: https&gt;<br></div><div> &gt;<br></div><div> &gt; another example:<br></div><div> &gt;<br></div><div> &gt; C:\Users\zahransa\anaconda3\python.exe C:/Users/zahransa/PycharmProjects/opm/plot_mne_inverse_connectivity_spectrum.py<br></div><div> &gt; Traceback (most recent call last):<br></div><div> &gt;&nbsp;&nbsp; File "C:/Users/zahransa/PycharmProjects/opm/plot_mne_inverse_connectivity_spectrum.py", line 13, in &lt;module&gt;<br></div><div> &gt;&nbsp;&nbsp;&nbsp;&nbsp; import matplotlib.pyplot as plt<br></div><div> &gt;&nbsp;&nbsp; File "C:\Users\zahransa\anaconda3\lib\site-packages\matplotlib\__init__.py", line 205, in &lt;module&gt;<br></div><div> &gt;&nbsp;&nbsp;&nbsp;&nbsp; _check_versions()<br></div><div> &gt;&nbsp;&nbsp; File "C:\Users\zahransa\anaconda3\lib\site-packages\matplotlib\__init__.py", line 190, in _check_versions<br></div><div> &gt;&nbsp;&nbsp;&nbsp;&nbsp; from . import ft2font<br></div><div> &gt; ImportError: DLL load failed: Le module sp?cifi? est introuvable.<br></div><div> &gt;<br></div><div> &gt; Thank you for your help,<br></div><div> &gt;<br></div><div> &gt; Best regards<br></div><div> &gt; Saeed Zahran<br></div><div> &gt;<br></div><div> &gt; ---------------------------------------------------------------<br></div><div> &gt;<br></div><div> &gt; From: mne_analysis-bounces@nmr.mgh.harvard.edu &lt;mne_analysis-bounces@nmr.mgh.harvard.edu&gt; on behalf of mne_analysis-request@nmr.mgh.harvard.edu &lt;mne_analysis-request@nmr.mgh.harvard.edu&gt;<br></div><div> &gt; Sent: Saturday, April 4, 2020 12:35 PM<br></div><div> &gt; To: mne_analysis@nmr.mgh.harvard.edu &lt;mne_analysis@nmr.mgh.harvard.edu&gt;<br></div><div> &gt; Subject: Mne_analysis Digest, Vol 147, Issue 10<br></div><div> &gt;<br></div><div> &gt; Send Mne_analysis mailing list submissions to<br></div><div> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mne_analysis@nmr.mgh.harvard.edu<br></div><div> &gt;<br></div><div> &gt; To subscribe or unsubscribe via the World Wide Web, visit<br></div><div> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis"> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br></div><div> &gt; or, via email, send a message with subject or body 'help' to<br></div><div> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mne_analysis-request@nmr.mgh.harvard.edu<br></div><div> &gt;<br></div><div> &gt; You can reach the person managing the list at<br></div><div> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mne_analysis-owner@nmr.mgh.harvard.edu<br></div><div> &gt;<br></div><div> &gt; When replying, please edit your Subject line so it is more specific<br></div><div> &gt; than "Re: Contents of Mne_analysis digest..."<br></div><div> &gt;<br></div><div> &gt; Today's Topics:<br></div><div> &gt;<br></div><div> &gt;&nbsp;&nbsp;&nbsp; 1. Re: Temporal Generalization - Different results with and<br></div><div> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; without using cross validation (Maryam Zolfaghar)<br></div><div> &gt;&nbsp;&nbsp;&nbsp; 2. MNE-BIDS 0.4 released! (Stefan Appelhoff)<br></div><div> &gt;<br></div><div> &gt; ----------------------------------------------------------------------<br></div><div> &gt;<br></div><div> &gt; Message: 1<br></div><div> &gt; Date: Fri, 3 Apr 2020 16:17:56 -0400<br></div><div> &gt; From: Maryam Zolfaghar &lt;Maryam.Zolfaghar@colorado.edu&gt;<br></div><div> &gt; Subject: Re: [Mne_analysis] Temporal Generalization - Different<br></div><div> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; results with and without using cross validation<br></div><div> &gt; To: Alexandre Gramfort &lt;alexandre.gramfort@inria.fr&gt;<br></div><div> &gt; Cc: Discussion and support forum for the users of MNE Software<br></div><div> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;mne_analysis@nmr.mgh.harvard.edu&gt;<br></div><div> &gt; Message-ID:<br></div><div> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;CAJOF5UAMPtJZPd-_CrmK8=GfZJ34Sm9m=5-weidvTbmBT_+vxw@mail.gmail.com&gt;<br></div><div> &gt; Content-Type: text/plain; charset="utf-8"<br></div><div> &gt;<br></div><div> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; External Email - Use Caution<br></div><div> &gt;<br></div><div> &gt; Hi Alex,<br></div><div> &gt;<br></div><div> &gt; Thanks a lot for the helpful information. I have run my code according to<br></div><div> &gt; your suggestion but I want to make sure I understood your point correctly.<br></div><div> &gt;<br></div><div> &gt; As you suggested, the difference in results might be due to "shuffle=True".<br></div><div> &gt; However, I do not understand why you suggested "*StratifiedShuffleSplit* "?<br></div><div> &gt; what would be the difference between doing "cv = *StratifiedKFold*<br></div><div> &gt; *(n_splits=5*, shuffle=True, random_state=42) or cv =<br></div><div> &gt; *StratifiedKFold**(*n_splits=5,<br></div><div> &gt; *shuffle=False*)"&nbsp;&nbsp;&nbsp; vs&nbsp;&nbsp; "cv = *StratifiedShuffleSplit*(*n_splits=1000*,<br></div><div> &gt; random_state=42)"? Why not only setting random state and just using "cv =<br></div><div> &gt; *StratifiedShuffleSplit*(*n_splits=5*, random_state=42)"&nbsp; with the same<br></div><div> &gt; number of splits?<br></div><div> &gt;<br></div><div> &gt; Thanks,<br></div><div> &gt; -Maryam<br></div><div> &gt;<br></div><div> &gt; On Wed, Mar 25, 2020 at 4:15 PM Alexandre Gramfort &lt;<br></div><div> &gt; alexandre.gramfort@inria.fr&gt; wrote:<br></div><div> &gt;<br></div><div> &gt;&gt; hi,<br></div><div> &gt;&gt;<br></div><div> &gt;&gt; when you do:<br></div><div> &gt;&gt;<br></div><div> &gt;&gt; *cv = StratifiedKFold(n_splits=5, shuffle=True)*<br></div><div> &gt;&gt;<br></div><div> &gt;&gt; *you make the cross-validation folds random (shuffle=True). It means*<br></div><div> &gt;&gt; *that everytime you run the code you will get a different value. This the<br></div><div> &gt;&gt; inherent*<br></div><div> &gt;&gt;<br></div><div> &gt;&gt; *variance of the statistic that cross-validation reports.*<br></div><div> &gt;&gt;<br></div><div> &gt;&gt; *To avoid this randomness (which should not be neglected) you can fix the<br></div><div> &gt;&gt; random state eg*<br></div><div> &gt;&gt;<br></div><div> &gt;&gt; cv = StratifiedKFold(n_splits=5, shuffle=True, random_state=42)<br></div><div> &gt;&gt;<br></div><div> &gt;&gt; to avoid this you should use a StratifiedShuffleSplit and use many folds<br></div><div> &gt;&gt; eg 100 to limit<br></div><div> &gt;&gt; the variance due to the choice of the cv splits.<br></div><div> &gt;&gt;<br></div><div> &gt;&gt; HTH<br></div><div> &gt;&gt; Alex<br></div><div> &gt;&gt;<br></div><div> &gt;&gt;<br></div><div> &gt;&gt;<br></div><div> &gt;&gt; On Wed, Mar 25, 2020 at 4:39 PM Maryam Zolfaghar &lt;<br></div><div> &gt;&gt; Maryam.Zolfaghar@colorado.edu&gt; wrote:<br></div><div> &gt;&gt;<br></div><div> &gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; External Email - Use Caution<br></div><div> &gt;&gt;&gt;<br></div><div> &gt;&gt;&gt; Hi MNE experts,<br></div><div> &gt;&gt;&gt;<br></div><div> &gt;&gt;&gt; I am using the temporal generalization<br></div><div> &gt;&gt;&gt; &lt;<a href="https://secure-web.cisco.com/1jWVu354v-yk2PHG6scpRuNlqi-Xei3wH-moV9-Av0fstdMSB7aUnzzNvmfnF3JuIo6EC0A07IdflTTdP4WpUqpUrZSclzoSV8WBksahu0ODpDgFOsHmm6eHO0i8QuTC6bAvL9yb4XuOmHH4wqg_ubbDuEIZUQriZvysI-ayKjx5o4jndHXz4UqLxv0CVaHv0YafoA8c9X29SwV52DKgOaPlf2v1oiEOTcd-Wu6QtvRMnn5AgMVc4_QxbHaXjM5qAZz8u1r_wFixIzhsSgFa89d05jmOT0BVNWMZ1-sXCPt0by2krKKqiEyV7OLYBLLMrTTnWZ00KZGIGX_VkqbIA4uArHPJxE7w_U3mNvn0YFXUUhVuopodRcQf_ZA81GJA5E5Qy5s6PW0ZP8SjUtICoajBkEHmm6LpIKycpscbg0W7uVdtFNyDkDTMXVq0OemdyrFxvdqDi6VnKPtgefbyyNw/https%3A%2F%2Fmne.tools%2Fdev%2Fauto_tutorials%2Fmachine-learning%2Fplot_sensors_decoding.html%23temporal-generalization">https://secure-web.cisco.com/1jWVu354v-yk2PHG6scpRuNlqi-Xei3wH-moV9-Av0fstdMSB7aUnzzNvmfnF3JuIo6EC0A07IdflTTdP4WpUqpUrZSclzoSV8WBksahu0ODpDgFOsHmm6eHO0i8QuTC6bAvL9yb4XuOmHH4wqg_ubbDuEIZUQriZvysI-ayKjx5o4jndHXz4UqLxv0CVaHv0YafoA8c9X29SwV52DKgOaPlf2v1oiEOTcd-Wu6QtvRMnn5AgMVc4_QxbHaXjM5qAZz8u1r_wFixIzhsSgFa89d05jmOT0BVNWMZ1-sXCPt0by2krKKqiEyV7OLYBLLMrTTnWZ00KZGIGX_VkqbIA4uArHPJxE7w_U3mNvn0YFXUUhVuopodRcQf_ZA81GJA5E5Qy5s6PW0ZP8SjUtICoajBkEHmm6LpIKycpscbg0W7uVdtFNyDkDTMXVq0OemdyrFxvdqDi6VnKPtgefbyyNw/https%3A%2F%2Fmne.tools%2Fdev%2Fauto_tutorials%2Fmachine-learning%2Fplot_sensors_decoding.html%23temporal-generalization</a>&gt;
 approach.<br></div><div> &gt;&gt;&gt; I have plotted scores' output from cross_val_multiscore<br></div><div> &gt;&gt;&gt; &lt;<a href="https://secure-web.cisco.com/1h1fBYrY82nc7Ha3ohR5V_l8-7FgWv1EKHCEhN_hAJm8A-NfF2V7uxTWmy5IwO-cOk33FiOpkywzhHZcxjWQfQez3GPysxi2nGr5NkcO-UbypLFGD_4d5yopqahopnYqwDy-b5yOA56uFYbRzHJLYyu6NsGNICQkbBWbwDt1EXOgxAFYg6wK5WIcxNYuZ9Jg_4G88dlreZRD8p-yNwFZ7D7z_DBKIo8eudHagdQhME0woFuPo63yrIoM4zLcAWLhFta-xNl2IvYh9iTIk5U5zUwFIbyRBa4HIWRD-Es3MGFPRcDmjke4u-MSG4yKuwjcIIfy3K4MCoiMF79wTrt2u-SutYTmMNte1IFDKYhw-kx7oH-XbtFkLZH1xigiLkdICoIFeZnptCIYr0Cu1mb75-E8SZD17l2y3xvLlgqZQ2aOYCPoFgCdlbtaBN7GhzUzeunr0EMGN7y6_W-4o-9ASig/https%3A%2F%2Fmne.tools%2Fdev%2Fgenerated%2Fmne.decoding.cross_val_multiscore.html%23mne.decoding.cross_val_multiscore">https://secure-web.cisco.com/1h1fBYrY82nc7Ha3ohR5V_l8-7FgWv1EKHCEhN_hAJm8A-NfF2V7uxTWmy5IwO-cOk33FiOpkywzhHZcxjWQfQez3GPysxi2nGr5NkcO-UbypLFGD_4d5yopqahopnYqwDy-b5yOA56uFYbRzHJLYyu6NsGNICQkbBWbwDt1EXOgxAFYg6wK5WIcxNYuZ9Jg_4G88dlreZRD8p-yNwFZ7D7z_DBKIo8eudHagdQhME0woFuPo63yrIoM4zLcAWLhFta-xNl2IvYh9iTIk5U5zUwFIbyRBa4HIWRD-Es3MGFPRcDmjke4u-MSG4yKuwjcIIfy3K4MCoiMF79wTrt2u-SutYTmMNte1IFDKYhw-kx7oH-XbtFkLZH1xigiLkdICoIFeZnptCIYr0Cu1mb75-E8SZD17l2y3xvLlgqZQ2aOYCPoFgCdlbtaBN7GhzUzeunr0EMGN7y6_W-4o-9ASig/https%3A%2F%2Fmne.tools%2Fdev%2Fgenerated%2Fmne.decoding.cross_val_multiscore.html%23mne.decoding.cross_val_multiscore</a>&gt;<br></div><div> &gt;&gt;&gt; with a RepeatedStratifiedKFold<br></div><div> &gt;&gt;&gt; &lt;<a href="https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.RepeatedStratifiedKFold.html#sklearn.model_selection.RepeatedStratifiedKFold">https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.RepeatedStratifiedKFold.html#sklearn.model_selection.RepeatedStratifiedKFold</a>&gt;<br></div><div> &gt;&gt;&gt;&nbsp; cv parameter.&nbsp; I have also plotted training scores<br></div><div> &gt;&gt;&gt;<br></div><div> &gt;&gt;&gt; I assumed that I should get the same result and the only difference would<br></div><div> &gt;&gt;&gt; be the diagonal results where the diagonal training scores will be all 1.<br></div><div> &gt;&gt;&gt; However, the general results are quite different (you can still see some<br></div><div> &gt;&gt;&gt; fade underlying pattern similar in both).<br></div><div> &gt;&gt;&gt;<br></div><div> &gt;&gt;&gt; Any idea of why plotting scores using cross-validation v.s. only<br></div><div> &gt;&gt;&gt; plotting fitting/training scores will give different results?<br></div><div> &gt;&gt;&gt;<br></div><div> &gt;&gt;&gt; This is my understanding of what should be going on: in the training case<br></div><div> &gt;&gt;&gt; without using any cross-validation, on each time point, there was a<br></div><div> &gt;&gt;&gt; classifier/decoder that was trained by seeing all EEG channels' data over<br></div><div> &gt;&gt;&gt; all epochs at that train time point, therefore it would give a perfect<br></div><div> &gt;&gt;&gt; score on the same test time point.&nbsp; However, a different time point<br></div><div> &gt;&gt;&gt; (testing times) has different data that can be seen as a test set for this<br></div><div> &gt;&gt;&gt; decoder. Right? (Even if there was an autocorrelation between EEG data over<br></div><div> &gt;&gt;&gt; time and still see some meaningful pattern in time generalization matrix,<br></div><div> &gt;&gt;&gt; it means that EEG data had task-related information over time which is<br></div><div> &gt;&gt;&gt; still meaningful).<br></div><div> &gt;&gt;&gt;<br></div><div> &gt;&gt;&gt; ---------<br></div><div> &gt;&gt;&gt; I have also put my code here:<br></div><div> &gt;&gt;&gt;<br></div><div> &gt;&gt;&gt; *Scores using cross-validation:*<br></div><div> &gt;&gt;&gt;<br></div><div> &gt;&gt;&gt; *clf_SVC&nbsp; = make_pipeline(*<br></div><div> &gt;&gt;&gt; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StandardScaler(),*<br></div><div> &gt;&gt;&gt; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LinearModel(LinearSVC(random_state=0,<br></div><div> &gt;&gt;&gt; max_iter=10000)))*<br></div><div> &gt;&gt;&gt;<br></div><div> &gt;&gt;&gt; *temp_gen = GeneralizingEstimator(clf_SVC, scoring='roc_auc',<br></div><div> &gt;&gt;&gt; n_jobs=1,verbose=True)*<br></div><div> &gt;&gt;&gt;<br></div><div> &gt;&gt;&gt; *cv = StratifiedKFold(n_splits=5, shuffle=True)*<br></div><div> &gt;&gt;&gt; *scores = cross_val_multiscore(temp_gen, X, y, cv=cv, n_jobs=1)*<br></div><div> &gt;&gt;&gt;<br></div><div> &gt;&gt;&gt; *Only fitting scores:*<br></div><div> &gt;&gt;&gt;<br></div><div> &gt;&gt;&gt; *temp_gen.fit(X=X ,y=y)*<br></div><div> &gt;&gt;&gt; *scores = temp_gen.score(X=X, y=y) #scores without cv*<br></div><div> &gt;&gt;&gt; *-----------*<br></div><div> &gt;&gt;&gt;<br></div><div> &gt;&gt;&gt; - I will appreciate any comments,<br></div><div> &gt;&gt;&gt; Thanks<br></div><div> &gt;&gt;&gt;<br></div><div> &gt;&gt;&gt;<br></div><div> &gt;&gt;&gt;<br></div><div> &gt;&gt;&gt;<br></div><div> &gt;&gt;&gt;<br></div><div> &gt;&gt;&gt;<br></div><div> &gt;&gt;&gt;<br></div><div> &gt;&gt;&gt;<br></div><div> &gt;&gt;&gt; _______________________________________________<br></div><div> &gt;&gt;&gt; Mne_analysis mailing list<br></div><div> &gt;&gt;&gt; Mne_analysis@nmr.mgh.harvard.edu<br></div><div> &gt;&gt;&gt; <a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br></div><div> &gt;&gt;<br></div><div> &gt;&gt;<br></div><div> &gt; -------------- next part --------------<br></div><div> &gt; An HTML attachment was scrubbed...<br></div><div> &gt; URL: <a href="http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200403/556f65b1/attachment-0001.html"> http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200403/556f65b1/attachment-0001.html</a><br></div><div> &gt;<br></div><div> &gt; ------------------------------<br></div><div> &gt;<br></div><div> &gt; Message: 2<br></div><div> &gt; Date: Sat, 4 Apr 2020 11:35:13 +0200<br></div><div> &gt; From: Stefan Appelhoff &lt;stefan.appelhoff@mailbox.org&gt;<br></div><div> &gt; Subject: [Mne_analysis] MNE-BIDS 0.4 released!<br></div><div> &gt; To: mne_analysis@nmr.mgh.harvard.edu<br></div><div> &gt; Message-ID: &lt;72db9be7-7537-77b9-5685-3a3a0d8b1d7b@mailbox.org&gt;<br></div><div> &gt; Content-Type: text/plain; charset="utf-8"; format="flowed"<br></div><div> &gt;<br></div><div> &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; External Email - Use Caution<br></div><div> &gt;<br></div><div> &gt; Dear MNE community,<br></div><div> &gt;<br></div><div> &gt; shortly after MNE 0.20 was released, we now proudly release MNE-BIDS 0.4<br></div><div> &gt; for all of you using the Brain Imaging Data Structure (BIDS) in your work.<br></div><div> &gt;<br></div><div> &gt; Next to several bug fixes and an improved documentation, there are some<br></div><div> &gt; new exciting features such as an improved automatic anonymization of<br></div><div> &gt; datasets. Check it out!<br></div><div> &gt;<br></div><div> &gt; - BIDS: <a href="https://bids.neuroimaging.io/">https://bids.neuroimaging.io/</a><br></div><div> &gt;<br></div><div> &gt; - MNE-BIDS: <a href="https://mne.tools/mne-bids/stable/index.html">https://mne.tools/mne-bids/stable/index.html</a><br></div><div> &gt;<br></div><div> &gt; Best regards,<br></div><div> &gt;<br></div><div> &gt; your MNE-BIDS team<br></div><div> &gt;<br></div><div> &gt; ------------------------------<br></div><div> &gt;<br></div><div> &gt; _______________________________________________<br></div><div> &gt; Mne_analysis mailing list<br></div><div> &gt; Mne_analysis@nmr.mgh.harvard.edu<br></div><div> &gt; <a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br></div><div> &gt;<br></div><div> &gt; End of Mne_analysis Digest, Vol 147, Issue 10<br></div><div> &gt; *********************************************<br></div><div> -------------- next part --------------<br></div><div> An HTML attachment was scrubbed...<br></div><div> URL: <a href="http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200404/021bcd69/attachment.html"> http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200404/021bcd69/attachment.html</a> <br></div><div> <br></div><div> ------------------------------<br></div><div> <br></div><div> _______________________________________________<br></div><div> Mne_analysis mailing list<br></div><div> Mne_analysis@nmr.mgh.harvard.edu<br></div><div> <a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br></div><div> <br></div><div> End of Mne_analysis Digest, Vol 147, Issue 12<br></div><div> *********************************************<br></div></div></span></span></div></blockquote><div><br></div>