skada.utils.check_X_y_domain
- skada.utils.check_X_y_domain(X, y, sample_domain=None, allow_source: bool = True, allow_multi_source: bool = True, allow_target: bool = True, allow_multi_target: bool = True, allow_common_domain_idx: bool = True, allow_auto_sample_domain: bool = True, allow_nd: bool = False, allow_label_masks: bool = True)[source]
Input validation for domain adaptation (DA) estimator. If we work in single-source and single target mode, return source and target separately to avoid additional scan for 'sample_domain' array.
- Parameters:
- Xarray-like of shape (n_samples, n_features)
Input features
- yarray-like of shape (n_samples,)
Target variable
- sample_domainarray-like, scalar, or None, optional (default=None)
Array specifying the domain labels for each sample. A scalar value can be provided to assign all samples to the same domain.
- allow_sourcebool, optional (default=True)
Allow the presence of source domains.
- allow_multi_sourcebool, optional (default=True)
Allow multiple source domains.
- allow_targetbool, optional (default=True)
Allow the presence of target domains.
- allow_multi_targetbool, optional (default=True)
Allow multiple target domains.
- allow_common_domain_idxbool, optional (default=True)
Allow the same domain index to be used for source and target domains, e.g 1 for a source domain and -1 for a target domain.
- allow_auto_sample_domainbool, optional (default=True)
Allow automatic generation of sample_domain if not provided.
- allow_ndbool, optional (default=False)
Allow X and y to be N-dimensional arrays.
- allow_label_masksbool, optional (default=True)
Allow NaNs in y.
- Returns:
- Xarray
Input features
- yarray
Target variable
- sample_domainarray
Array specifying the domain labels for each sample.