Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document "orig_model" parameter in harmonizationLearn #42

Open
olfMombach opened this issue Mar 12, 2024 · 0 comments
Open

Document "orig_model" parameter in harmonizationLearn #42

olfMombach opened this issue Mar 12, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@olfMombach
Copy link

It seems as if this is not documented in any way

def harmonizationLearn(data, covars, eb=True, smooth_terms=[],
smooth_term_bounds=(None, None), return_s_data=False,
orig_model=None, seed=None):
"""
Wrapper for neuroCombat function that returns the harmonization model.
Arguments
---------
data : a numpy array
data to harmonize with ComBat, dimensions are N_samples x N_features
covars : a pandas DataFrame
contains covariates to control for during harmonization
all covariates must be encoded numerically (no categorical variables)
must contain a single column "SITE" with site labels for ComBat
dimensions are N_samples x (N_covariates + 1)
eb : bool, default True
whether to use empirical Bayes estimates of site effects
smooth_terms (Optional) : a list, default []
names of columns in covars to include as smooth, nonlinear terms
can be any or all columns in covars, except "SITE"
if empty, ComBat is applied with a linear model of covariates
if not empty, Generalized Additive Models (GAMs) are used
will increase computation time due to search for optimal smoothing
smooth_term_bounds (Optional) : tuple of float, default (None, None)
feature to support custom boundaries of the smoothing terms
useful when holdout data covers different range than
specify the bounds as (minimum, maximum)
currently not supported for models with mutliple smooth terms
return_s_data (Optional) : bool, default False
whether to return s_data, the standardized data array
can be useful for diagnostics but will be costly to save/load if large
seed (Optional) : int, default None
By default, this function is non-deterministic. Setting the optional
argument `seed` will make the function deterministic.
Returns
-------
model : a dictionary of estimated model parameters
design, var_pooled, B_hat, grand_mean,
gamma_star, delta_star, info_dict (a neuroCombat invention),
gamma_hat, delta_hat, gamma_bar, t2, a_prior, b_prior, smooth_model
bayes_data : a numpy array
harmonized data, corrected for effects of SITE
dimensions are N_samples x N_features
s_data (Optional) : a numpy array
standardized residuals after accounting for `covars` other than `SITE`
set return_s_data=True to output the variable
"""

@rpomponio rpomponio added the documentation Improvements or additions to documentation label Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants