UnitFilterById#

class torch_brain.transforms.UnitFilterById(pattern, field, reset_index=True, keep_matches=True)[source]#

Bases: torch_brain.transforms.unit_filter.UnitFilter

Keep/drop units based on the keyword/regex given in the constructor. Filtering is done based on the unit ids. Whether to keep or drop is based on the keep_matches argument.

Parameters:
  • pattern (str | Pattern) – The regex pattern to match against the unit ids.

  • field (str) – The field to apply the filter.

  • reset_index (bool) – If True, it will reset_index the unit index of the time series.

  • keep_matches (bool) – If True, units matching the pattern will be kept.