neuroharmony.exclude_single_subject_groups

neuroharmony.exclude_single_subject_groups(df, covariates)[source]

Exclude categories with only one subject.

Parameters
dfNDFrame of shape [n_subjects, n_features]

Pandas DataFrame in the Neuroharmony input format containing the variables in the covariates list.

covariateslist

List of covariates for which the Harmonization should eliminate or conserve.

Returns
dfNDFrame of shape [n_subjects, n_features]

Padas DataFrame excluding the subjects that would result in a single subject split of the covariates grouping.