skada.utils.extract_domains_indices

skada.utils.extract_domains_indices(sample_domain, split_source_target=False)[source]

Extract the indices of the specific domain samples.

Parameters:
sample_domainarray-like of shape (n_samples,)

Array specifying the domain labels for each sample.

split_source_targetbool, optional (default=False)

Whether to split the source and target domains.

Returns:
domains_idxdict

A dictionary where keys are unique domain labels and values are indexes of the samples belonging to the corresponding domain.

If split_source_target is True, then two dictionaries are returned:
  • source_idx: keys >= 0

  • target_idx: keys < 0