<p>First of all, I would recommend working with a domain specific (EEG) and established analysis package of your choice. You mentioned python, so I would advise you to check out <a href="https://www.martinos.org/mne/stable/index.html" rel="nofollow noreferrer">MNE-Python</a>. There is a <a href="https://www.martinos.org/mne/stable/auto_tutorials/plot_artifacts_correction_ica.html" rel="nofollow noreferrer">tutorial</a> regarding eyeblink detection/correction/rejection from EEG data that you could work through.</p>

<p>To answer your general question, ICA and PCA are typically done on the complete data matrix, i.e., each row of the data matrix is a channel and each column is a sampled timepoint (values in microvolts).</p>

CC BY-SA 4.0
2018-06-02T10:55:54.983Z
2018-06-02T10:55:54.983Z
S.A.
<p>I am very new to this type of neuroscience research and I am trying to do some automatic artifact detection. I am having trouble understanding how I should work with my data. I have data recorded from 20 electrodes on my EEG. The outputs are all in microVolts and are recordings for only one person doing eye blinking during the recording. My question is, now that I have the data from the 20 electrodes, how would I do PCA or ICA analysis on them? Like should I apply sklearn (from python) PCA or ICA option to the whole matrix, meaning to the whole data of the 20 electrodes, at once or should I apply these options to the measurements from one electrodes at a time and then combine them? </p>

<p>Thanks so much for your help and let me know if more specificity in the question is needed. </p>

<eeg><signal-detection>
Doing PCA and ICA analysis on EEG data with 24 channels
user110320
# Doing PCA and ICA analysis on EEG data with 24 channels

(Asked by: username_0 on 2018-05-29)

I am very new to this type of neuroscience research and I am trying to do some automatic artifact detection. I am having trouble understanding how I should work with my data. I have data recorded from 20 electrodes on my EEG. The outputs are all in microVolts and are recordings for only one person doing eye blinking during the recording. My question is, now that I have the data from the 20 electrodes, how would I do PCA or ICA analysis on them? Like should I apply sklearn (from python) PCA or ICA option to the whole matrix, meaning to the whole data of the 20 electrodes, at once or should I apply these options to the measurements from one electrodes at a time and then combine them?

Thanks so much for your help and let me know if more specificity in the question is needed.

**Tags:** eeg, signal-detection


---

## 1 answers

### Answer by username_1 on 2018-06-02. Score: 3 | Accepted answer

First of all, I would recommend working with a domain specific (EEG) and established analysis package of your choice. You mentioned python, so I would advise you to check out [MNE-Python](https://www.martinos.org/mne/stable/index.html). There is a [tutorial](https://www.martinos.org/mne/stable/auto_tutorials/plot_artifacts_correction_ica.html) regarding eyeblink detection/correction/rejection from EEG data that you could work through.

To answer your general question, ICA and PCA are typically done on the complete data matrix, i.e., each row of the data matrix is a channel and each column is a sampled timepoint (values in microvolts).


---

