Getting partially clean epochs from autoreject

I’m dealing with long continuous data, and I split them into around epochs of 30s-1min. Autoreject will remove epochs that are bad, I assume these are epochs that can’t be repaired?

To save as much data as possible, I’m wondering if there’s a way to not drop these bad epochs, and only take the clean channels in those epochs instead? (My analysis can handle variable number of sensors)

Hi, you can retrieve the reject log:

ar = autoreject.AutoReject(…)
ar.fit(epochs)
epochs_ar, reject_log = ar.transform(epochs, return_log=True)

Then, use reject_log.bad_epochs to list bad epochs and reject_log.labels to retrieve which channels are bad in those epochs.

Best wishes,
Richard

Thank you so much for the quick answer! This is exactly what I need.