Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_deconfounder(xfm_name, grid_search_level=None):
"""Returns a valid sklearn transformer for deconfounding."""
xfm_name = xfm_name.lower()
if xfm_name in ('residualize', 'regressout',
'residualize_linear', 'regressout_linear'):
from confounds.base import Residualize
xfm = Residualize()
param_list_values = []
# elif name in ('residualize_ridge', 'residualize_kernelridge'):
# from confounds.base import Residualize
# xfm = Residualize(model='KernelRidge')
# param_list_values = [('param_1', range_param1),
# ('criterion_2', criteria),
# ]
# elif name in ('residualize_gpr', 'residualize_gaussianprocessregression'):
# from confounds.base import Residualize
# xfm = Residualize(model='GPR')
# param_list_values = [('param_1', range_param1),
# ('criterion_2', criteria),
# ]
elif xfm_name in ('augment', 'pad'):
from confounds.base import Augment
xfm = Augment()