Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running trained models on different data #1

Open
Qwlouse opened this issue Nov 2, 2015 · 3 comments
Open

Running trained models on different data #1

Qwlouse opened this issue Nov 2, 2015 · 3 comments

Comments

@Qwlouse
Copy link

Qwlouse commented Nov 2, 2015

I've reproduced the results and verified that they are fine. However I'd like to run the trained models on some new data, and I can't seem to make that work. Maybe you could point me in the right direction? Is it at all possible without retraining everything, because to me it seems you didn't store any trained models, only their predictions.

@alexandrebarachant
Copy link
Owner

Hi Klaus,

The bad news is that we did not save the models so you will have to re-run things.
The good news is that you can keep validation predictions and therefore have to re-run only the test predictions.

Before getting to into the how to generate and save models, i strongly suggest to choose the "safe1" solution. It only involves a subset of 8 level2 models, and the performance does not change that much. It will be much faster to run.

Most of the change are concerning level1 models. I assume your new data are in the same format as the other ones, so here we go :

  • Update meta-info, in genInfos.py, you will have to point out to your new files (L33).
  • Re-run genInfos.py
  • In preprocessing/aux.py , change the path L44 to point the new files.
  • do the same thing for genPreds_CNN_Tim.py and genPreds_RNN.py
  • re-run lvl1 models in test mode only (modify lvl1/genAll.sh)
  • re-run lvl2 models in test mode only (modify lvl2/genSafe1.sh)

If you want to save models, you could use the guideline provided by sklearn : http://scikit-learn.org/stable/modules/model_persistence.html

For lvl1, you will have to save pre-processing model, post-preprocessing, and final classifyer. for lvl2, you just need to save the classifyer

@ut33
Copy link

ut33 commented Jul 9, 2018

When I try to run the code, I get an IndexError: list index is out of range
Is anyone else getting this problem? What should I do?


Traceback (most recent call last):
File "genInfos.py", line 35, in
raw_val = concatenate_raws([creat_mne_raw_object(fname, read_events=True) for fname in fnames_val])
File "", line 2, in concatenate_raws
File "C:\ProgramData\Anaconda3\envs\mne\lib\site-packages\mne\utils.py", line 729, in verbose
return function(*args, **kwargs)
File "C:\ProgramData\Anaconda3\envs\mne\lib\site-packages\mne\io\base.py", line 2500, in concatenate_raws
raws[0].append(raws[1:], preload)
IndexError: list index out of range

@kritigoyal
Copy link

@ut33 were you able to figure out how to resolve this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants