1st Steps of Session Saving

The first thing we need is a place to save the models. So the first step is to create a directory of BessyPy called session_saves and add to git ignore so that files inside are ignored.

Session saving is going to include many functions, so I think it warrants its own module. Which I propose calling session_saving. In the future this will include saving BIDS data, model cards, etc. But for now I only plan on adding save_classifier and load_classifier.

save_classifier(classifier object, filename)

Pickles the classifier in “session_saves” with a specified file name..

load_classifier(filename)

Loads the classifier from the pickle specified by file name. Returns the classifier object.

We also need a test to confirm that these functions work, so I am proposing the following manual save test.

test_manual_save

  1. Create an EEG data object, loads saved data, trains classifier, saves classifier (using the new function).
  2. Create another EEG data object, load saved data, load classifier, run main.
  3. Check for expected response, ie. same classifications as previous classifier, given same data and same model.