# Baseline without .average()

**URL:** <https://mne.discourse.group/t/baseline-without-average/8301>\
**Category:** Support & Discussions\
**Tags:** epochs\
**Created:** [February 8, 2024, 5:33pm UTC](https://mne.discourse.group/t/baseline-without-average/8301 "2024-02-08T17:33:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hugues1273](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/hugues1273/32/2423_2.png) [@Hugues1273](https://mne.discourse.group/u/Hugues1273)\
**Post date:** [February 8, 2024, 5:33pm UTC](https://mne.discourse.group/t/baseline-without-average/8301/1 "2024-02-08T17:33:22Z")

</div>

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:

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

```

Here is my short code:

```python
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!

Hugues

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [February 8, 2024, 5:42pm UTC](https://mne.discourse.group/t/baseline-without-average/8301/2 "2024-02-08T17:42:54Z")

</div>

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,  
Richard

---

<div class="post-metadata">

**Author:** ![Hugues1273](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/hugues1273/32/2423_2.png) [@Hugues1273](https://mne.discourse.group/u/Hugues1273)\
**Post date:** [February 10, 2024, 12:23pm UTC](https://mne.discourse.group/t/baseline-without-average/8301/3 "2024-02-10T12:23:44Z")

</div>

Thank you so much Richard!

Best regards,

Hugues

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [February 17, 2024, 12:24pm UTC](https://mne.discourse.group/t/baseline-without-average/8301/4 "2024-02-17T12:24:11Z")

</div>

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