Benchmark multi-model/multi-view models.
Note
This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the gallery for the big picture.
-
mmbench.residualize.residualize(train_df, train_data, test_df, test_data, formula_res=None, formula_full=None, site_name=None, discrete_vars=None, continuous_vars=None)[source]¶ Custom linear and/or site Combat residualization.
- Parameters
formula_res : str
what we want to residualize for ‘age + sex + site’ or ‘age + sex’ using linear regression.
formula_full : str
what we want to adjusted for e.g ‘age + sex + diagnosis’ or ‘age + sex + site + diagnosis’ using linear regression.
train_df : DataFrame
table defining the terms used in formula_full.
train_data : array (n_samples, n_features)
the training data.
test_df : DataFrame
table defining the terms used in formula_full.
test_data : array (n_samples, n_features)
the test data to be transformed.
site_name : str, default None
the name of the column containing the site information.
discrete_vars : list of str, default None
the name of the covariates which are categorical.
continuous_vars : list of str, default None
the name of the covariates which are continuous.
- Returns
train_data : array (n_samples, n_features)
the residualize training data.
test_data : array (n_samples, n_features)
the residualize test data.
Follow us