Module Expr Str ImportFrom alias Import alias identifier TryExcept body ImportFrom alias identifier handlers ExceptHandler type NameLoad body ImportFrom alias ImportFrom alias ImportFrom alias Import alias Import alias Import alias identifier Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Call AttributeLoad NameLoad attr Dict Str Num keyword Num keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr Num NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad BinOpMult Num NameLoad BinOpMult Num NameLoad Assign NameStore Num Assign NameStore Call NameLoad Call NameLoad NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr ListComp SubscriptLoad Call NameLoad Call NameLoad NameLoad Call NameLoad Call NameLoad NameLoad Index NameLoad comprehension NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Num Num Assign NameStore Num For TupleStore NameStore NameStore NameLoad body AugAssignAdd NameStore Num Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Index NameLoad Slice Slice SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr Assign AttributeStore AttributeLoad NameLoad attr attr Num Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Call NameLoad NameLoad Num For NameStore Call NameLoad Call NameLoad NameLoad body Expr Call NameLoad Call AttributeLoad Str attr NameLoad NameLoad NameLoad keyword Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Index NameLoad Slice Slice Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Slice Index Call AttributeLoad NameLoad attr CompareLt Num NameLoad CompareLt NameLoad Num keyword Num Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Slice Index Call AttributeLoad NameLoad attr CompareLt Num NameLoad CompareLt NameLoad Num keyword Num Assign SubscriptStore NameLoad ExtSlice Index NameLoad Slice Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad attr Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Index NameLoad Slice SubscriptLoad NameLoad Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Index NameLoad Slice SubscriptLoad NameLoad Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Index NameLoad Slice SubscriptLoad NameLoad Index NameLoad Expr Call NameLoad Call AttributeLoad Str attr NameLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Index NameLoad Slice AugAssignAdd NameStore Call NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad Expr Call NameLoad Str NameLoad Expr Call NameLoad Call AttributeLoad Str attr BinOpDiv Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad
N/A N/A 
This example shows how to decompose EEG signals into source activations with
CSPVARICA, and subsequently extract single-trial connectivity as features for
LDA classification.
 __future__ print_function N/A numpy np N/A N/A sklearn.discriminant_analysis LinearDiscriminantAnalysis LDA N/A N/A N/A ImportError N/A sklearn.lda LDA sklearn.cross_validation KFold sklearn.metrics confusion_matrix N/A scot N/A scot.xvschema N/A scotdata.motorimagery midata N/A raweeg N/A N/A midata eeg T N/A triggers N/A N/A np asarray N/A midata triggers dtype int N/A classes N/A midata classes N/A fs N/A midata samplerate N/A locs N/A midata locations N/A N/A N/A N/A np random seed 42 N/A N/A N/A N/A scot backend activate sklearn N/A ws N/A N/A scot Workspace N/A model_order 30 reducedim 4 fs fs N/A freq N/A N/A np linspace 0 fs N/A ws nfft_ N/A data N/A N/A N/A scot datatools cut_segments raweeg triggers N/A 3 fs N/A 4 fs N/A nfolds 10 N/A kf N/A KFold N/A len triggers n_folds nfolds N/A cl N/A N/A np unique N/A midata classes N/A classids N/A N/A np array N/A N/A N/A dict N/A zip cl N/A range N/A len cl N/A c N/A c N/A midata classes N/A lda N/A LDA N/A cm N/A N/A np zeros N/A 2 2 N/A fold 0 N/A N/A train test kf N/A N/A fold 1 N/A N/A N/A ws set_data N/A data N/A N/A train N/A N/A N/A classes N/A train N/A N/A N/A ws do_cspvarica N/A N/A N/A ws var_ delta 1 N/A features N/A N/A np zeros N/A N/A len triggers 32 N/A t N/A range N/A len triggers N/A N/A N/A print N/A N/A Fold {:2d}/{:2d}, trial: {:d}    format fold nfolds t end N/A N/A N/A ws set_data N/A data N/A N/A t N/A N/A N/A N/A N/A ws fit_var N/A con N/A N/A ws get_connectivity ffPDC N/A alpha N/A N/A np mean N/A con N/A N/A N/A N/A N/A N/A np logical_and N/A 7 freq N/A freq 13 axis 2 N/A beta N/A N/A np mean N/A con N/A N/A N/A N/A N/A N/A np logical_and N/A 15 freq N/A freq 25 axis 2 N/A N/A features N/A N/A t N/A N/A N/A N/A N/A np array N/A alpha beta flatten N/A N/A N/A lda fit N/A features N/A N/A train N/A N/A classids N/A train N/A acc_train N/A N/A lda score N/A features N/A N/A train N/A N/A classids N/A train N/A acc_test N/A N/A lda score N/A features N/A N/A test N/A N/A classids N/A test N/A N/A print N/A N/A Fold {:2d}/{:2d}, acc train: {:.3f}, acc test: {:.3f} format fold nfolds acc_train acc_test N/A pred N/A N/A lda predict N/A features N/A N/A test N/A N/A cm N/A confusion_matrix N/A classids N/A test pred N/A N/A print 
Confusion Matrix:
 cm N/A N/A print N/A N/A 
Total Accuracy: {:.3f} format N/A N/A N/A np sum N/A N/A np diag cm N/A N/A np sum cm