# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

from analyse_datasets import analyse_datasets, analyse_dataset, debug_test_dataset, debug_test_single_dataset
# %load_ext autoreload
# %autoreload 2

# + tags=[]
debug_test_single_dataset('p300_prn','rutger_prn_5_flip',
                          loader_args=dict(ofs=32,order=6,stopband=((0,1),(12,-1)),subtriallen=None),
                          preproc_args=dict(badChannelThresh=3,badTrialThresh=None),
                          model='cca',evtlabs=('re','anyre'),rank=4,tau_ms=750,reg=.02,badEpThresh=3)

# + tags=[]
debug_test_single_dataset('p300_prn','rutger_rc_5',
                          loader_args=dict(ofs=32,order=6,stopband=((0,1),(12,-1)),subtriallen=None),
                          preproc_args=dict(badChannelThresh=3,badTrialThresh=None),
                          model='cca',evtlabs=('re','anyre'),rank=4,tau_ms=750,reg=.02,badEpThresh=3)

# + tags=[]
debug_test_single_dataset('p300_prn','rutger_prn_15_flip',
                          loader_args=dict(ofs=32,order=6,stopband=((0,1),(12,-1)),subtriallen=None),
                          preproc_args=dict(badChannelThresh=3,badTrialThresh=None),
                          model='cca',evtlabs=('re','anyre'),rank=5,tau_ms=750,reg=.02,badEpThresh=3)

# + tags=[]
debug_test_single_dataset('p300_prn','rutger_prn_5_flip',
                          loader_args=dict(ofs=32,order=6,stopband=((0,1),(12,-1)),subtriallen=None),
                          preproc_args=dict(badChannelThresh=3,badTrialThresh=None),
                          model='lr',evtlabs=('re','anyre'),tau_ms=750,ignore_unlabelled=True,center=True)

# + tags=[]
debug_test_single_dataset('p300_prn','kirsten_rc_5',
                          loader_args=dict(ofs=32,order=6,stopband=((0,1),(12,-1)),subtriallen=None),
                          preproc_args=dict(badChannelThresh=3,badTrialThresh=3),
                          model='cca',evtlabs=('re','anyre'),rank=3,tau_ms=750,reg=.02,badEpThresh=6)

# + tags=[]
debug_test_single_dataset('p300_prn','alex_rc_5',
                          loader_args=dict(ofs=32,order=6,stopband=((0,1),(12,-1)),subtriallen=None),
                          preproc_args=dict(badChannelThresh=None,badTrialThresh=None),
                          model='cca',evtlabs=('re','anyre'),rank=3,tau_ms=750,reg=.02,badEpThresh=6)

# + tags=[]
debug_test_single_dataset('p300_prn','alex_prn_5',
                          loader_args=dict(ofs=32,order=6,stopband=((0,1),(12,-1)),subtriallen=None),
                          preproc_args=dict(badChannelThresh=None,badTrialThresh=None),
                          model='cca',evtlabs=('re','anyre'),rank=7,tau_ms=750,reg=.02)

# + tags=[]
debug_test_single_dataset('p300_prn','kirsten_prn_5_flip',
                          loader_args=dict(ofs=32,order=6,stopband=((0,1),(12,-1)),subtriallen=None),
                          preproc_args=dict(badChannelThresh=None,badTrialThresh=None),
                          model='cca',evtlabs=('re','anyre'),rank=5,tau_ms=750,reg=.02,badEpThresh=6)

# + tags=[]
debug_test_single_dataset('p300_prn','kirsten_rc_5',
                          loader_args=dict(ofs=32,order=6,stopband=((0,1),(12,-1)),subtriallen=None),
                          preproc_args=dict(badChannelThresh=3,badTrialThresh=3, whiten=.05),
                          evtlabs=('re','ntre'), model='lr', ignore_unlabelled=True,tau_ms=750,badEpThresh=None)

# + tags=[]
debug_test_single_dataset('p300_prn','jeroen_prn_5_flip',
                          loader_args=dict(ofs=32,order=6,stopband=((0,1),(12,-1)),subtriallen=None),
                          preproc_args=dict(badChannelThresh=3,badTrialThresh=None),
                          model='cca',evtlabs=('re','anyre'),rank=4,tau_ms=750,reg=.02,badEpThresh=3)

# + tags=[]
debug_test_single_dataset('p300_prn','linsey_prn_5_flip',
                          loader_args=dict(ofs=32,order=6,stopband=((0,1),(12,-1)),subtriallen=None),
                          preproc_args=dict(badChannelThresh=3,badTrialThresh=None),
                          model='cca',evtlabs=('re','anyre'),rank=4,tau_ms=750,reg=.02,badEpThresh=3)

# + tags=[]
debug_test_single_dataset('p300_prn','nan_prn_5_flip',
                          loader_args=dict(ofs=32,order=6,stopband=((0,1),(12,-1)),subtriallen=None),
                          preproc_args=dict(badChannelThresh=3,badTrialThresh=None),
                          model='cca',evtlabs=('re','anyre'),rank=4,tau_ms=750,reg=.02,badEpThresh=3)

# + tags=[]
# run visualization for all datasets for this condition.  Prn_5_flip
from datasets import get_dataset
l,fns,_ = get_dataset('p300_prn','prn_5_flip')
for fi in fns:
    print("\n\n---------------------------------- {} \n\n".format(fi))
    X,Y,coords=l(fi,ofs=32,order=6,stopband=((0,1),(12,-1)),subtriallen=None)
    debug_test_dataset(X,Y,coords,
                          preproc_args=dict(badChannelThresh=3,badTrialThresh=None),
                          model='cca',evtlabs=('re','anyre'),rank=4,tau_ms=750,reg=.02)
# -



StarcoderdataJupyterScriptsDedupFiltered