Baseline without .average()

Dear all,

I have epoched data. On these data I apply ICA without baseline and then I apply the baseline.
In the tutorial, for applying baseline correction, I saw : the following line code:

trad_aud = epochs["auditory"].average().apply_baseline(baseline)

Here is my short code:

Epochs = mne.Epochs(RawData_Notched, events = Events_from_annot, tmin = Tmin, tmax = Tmax, baseline = None, preload = True, event_id = {"Stimulus/S  5": 5, "Stimulus/S 10": 10, "Stimulus/S 14": 14})
ICAOnEpochs = mne.preprocessing.ICA(n_components = 30, max_iter = "auto", random_state = 97, method = "picard").fit(Epochs)
ICAOnEpochs.exclude = [0, 1, 2, 3, 4, 5]
Epochs_AfterICA = ICAOnEpochs.apply(Epochs)
Epochs_Baselined = Epochs_AfterICA.apply_baseline(Baseline)

Is it a good way to apply the baseline correction after processing ICA? Do I need to add the .average() method before .apply_baseline() as found in the tutorial?

Thank you all!


Hello, this looks good to me. The averaging step is only required if you want to create evoked data (ERPs/ERFs). But you can without any problems apply baseline correction to the epochs first and create evokeds at any later time (or never).

Best wishes,

Thank you so much Richard!

Best regards,


1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.