diff --git a/python/src/manocca.py b/python/src/manocca.py index 95ac228d643efdbad23d8d11118a8dca377f216b..8612fbd1a1f809c5cb4842a579d1678ce89792a9 100644 --- a/python/src/manocca.py +++ b/python/src/manocca.py @@ -99,7 +99,7 @@ class MANOCCA: """ def __init__(self, predictors, outputs, covariates=None, cols_outputs = None, - cols_predictors = None, cols_covariates = None, prodV_red=None, n_comp = None, prod_to_keep = None, use_resid = True, use_pca = True, use_extended = False, n_jobs = 1): + cols_predictors = None, cols_covariates = None, prodV_red=None, n_comp = None, prod_to_keep = None, use_resid = True, use_pca = True, adj_pred = False, use_extended = False, n_jobs = 1): ### Initializing self.outputs = outputs @@ -127,6 +127,7 @@ class MANOCCA: self.use_resid = use_resid self.use_pca = use_pca self.use_extended = use_extended + self.adj_pred = adj_pred # Filled later self.prodV = None @@ -169,8 +170,9 @@ class MANOCCA: print("computing residuals") print("adjusting outputs") self.prodV_red = np.apply_along_axis(lambda x : pt.adjust_covariates(x,covariates), axis = 0, arr = self.prodV_red) - print("adjusting predictor") - self.predictors = np.apply_along_axis(lambda x : pt.adjust_covariates(x,covariates), axis = 0, arr = self.predictors) + if self.adj_pred : + print("adjusting predictor") + self.predictors = np.apply_along_axis(lambda x : pt.adjust_covariates(x,covariates), axis = 0, arr = self.predictors) # print("adjusting predictor") # self.predictors = np.apply_along_axis(lambda x : pt.adjust_covariates(x,covariates), axis = 0, arr = self.predictors) # print(self.predictors.mean())