0

so for context, I'm using SVD (single value decomposition) for EEG analysis. I'm trying to get the V^t component (ie component vs channel matrix) and have M (ie sample vs channel matrix) over all the samples for the experiment. TO provide a little theoretical background: M = USV^t where M is the Event Related Potentials (ERPs) at each channel. I'm trying to get the single-trial ERPs and for this I'm multiplying the cleaned raw single E (total samples by channel) by V. E matrix is the entire cleaned EEG dataset. However, in the process of doing so I'm running into errors like the title or 'str' object has no attribute info. I thought the reason for this could be that the cleaned EEG pickle files I'm trying to load are being recognized as a string or dictionary which is the file location of the pickle file. I'm trying to figure out how to load the file into memory such that its a Python object with fields rather than a string or dictionary Sorry for the lengthy explanation, but I hope the context helps understand my bug! Thank you

This is how I'm loading the file:

fpath = "D:\\Research_Project\\analysis\\N200_VET\\results\\dataset1\\pickle_files\\subj08_1_N200_DataDict.pickle"
with open(fpath, "rb") as f:
     subj_data = pickle.load(f) 
print(subj_data) 

` This is where the error arises:

raw = subj_data
-- events = mne.find_events(
 raw, stim_channel="Status", shortest_event=1, initial_event=True, verbose=False) --
cleaned_events, df_trials = clean_events(events)
ica = mne.preprocessing.ICA

` This are the SVD lines:

u, s, v = np.linalg.svd(evoked_arr, full_matrices=0)

df_u = pd.DataFrame(u.T, columns=evoked_df_N200.index, index=evoked.ch_names)
df_u.columns.name = 'time'
df_u.index.name = 'components'

df_v = pd.DataFrame(v, columns=evoked.ch_names)
df_v.columns.name = "channels"
df_v.index.name = "components"

df_e = pd.DataFrame(e.T, columns=evoked_df_N200, index=df_v)
df_e.columns.name = "n200_window_data"
df_e.index.name = "channels"

M = df_e @ df_v`

-- line causing the error --

0 Answers0