Skip to content

Commit

Permalink
FIX Autoreject -> AutoReject + cosmits
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmainak committed Jun 11, 2018
1 parent 9cec763 commit 399ddba
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions doc/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,25 @@ ICA, and finally interpolating the bad data.

To ignore bad segments using autoreject (local), we could do::

>>> ar = Autoreject()
>>> _, reject_log = ar.fit(epochs).transform(epochs)
>>> ica.fit(epochs[~reject_log.bad_epochs_idx])
>>> ar = AutoReject()
>>> _, reject_log = ar.fit(epochs).transform(epochs, return_log=True)
>>> ica.fit(epochs[~reject_log.bad_epochs])

or use autoreject (global)::

>>> reject = get_rejection_threshold(epochs)
>>> ica.fit(epochs, reject=reject)

Then, we can apply ICA::
This option can be more preferred if we would like to fit ICA on the raw
data, and not on the epochs. After this, we can apply ICA::

>>> ica.exclude = [5, 7] # exclude EOG components
>>> ica.transform(epochs)

Finally, autoreject could be applied to clean the data::

>>> ar = Autoreject()
>>> epochs_clean = ar.fit(epochs).transform(epochs)
>>> ar = AutoReject()
>>> epochs_clean = ar.fit_transform(epochs)

Autoreject is not meant for eyeblink artifacts since it affects neighboring
sensors. Indeed, a spatial filtering method like ICA is better suited for this.
Expand All @@ -38,7 +39,7 @@ How do I manually set the `n_interpolate` and `consensus` parameter?
If you do not want autoreject to select a parameter for you, simply pass it
as a list of a single element::

>>> ar = Autoreject(n_interpolate=[1], consensus_percs=[0.6])
>>> ar = AutoReject(n_interpolate=[1], consensus_percs=[0.6])

Note this will still run a cross-validation loop to generate the
validation score.
Expand All @@ -49,6 +50,6 @@ Is it possible to get only bad sensor annotations and not interpolate?
Yes! Simply do::

>>> ar.fit(epochs)
>>> ar.get_reject_log(epochs)
>>> reject_log = ar.get_reject_log(epochs)

No need to run `ar.transform(epochs)` in this case.

0 comments on commit 399ddba

Please sign in to comment.