From 399ddba228b78b94c75025e01b8d8e46b713472b Mon Sep 17 00:00:00 2001 From: Mainak Jas Date: Mon, 11 Jun 2018 09:11:14 +0200 Subject: [PATCH] FIX Autoreject -> AutoReject + cosmits --- doc/faq.rst | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/doc/faq.rst b/doc/faq.rst index 98b06f2b..c217bd87 100644 --- a/doc/faq.rst +++ b/doc/faq.rst @@ -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. @@ -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. @@ -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.