eelbrain.ChannelModel.score

ChannelModel.score(data, threshold=5e-05, max_exclude=0.25)[source]

Score each sensor by how badly it is predicted from the others.

A high score identifies a bad channel. Within each epoch, the channel with the largest prediction error is scored with that error and then excluded (its input is replaced with its prediction from the other channels, so it no longer contaminates the remaining channels); this repeats until no channel’s error exceeds threshold, at which point the remaining channels are scored with their current error.

Parameters:
  • data (NDVar | str | list) – EEG data ([case x] sensor x time) with the same sensors used for fitting. A list of long, variable-length epochs is also accepted; use find_bad_windows() instead to score those time-resolved.

  • threshold (float) – Stop excluding channels once the largest error drops to this absolute value (default 50 µV).

  • max_exclude (float) – Maximum number of channels to exclude per epoch. A value < 1 is interpreted as a fraction of the sensors (default 0.25); a value ≥ 1 as an absolute count.

Returns:

score – The per-channel error score ([case x] sensor). For a list of long epochs, a Datalist with one score NDVar per epoch.

Return type:

NDVar | Datalist