Skip to content
Snippets Groups Projects
Commit 50197134 authored by Christophe  BOETTO's avatar Christophe BOETTO
Browse files

added param for predictor adjustment

parent ae33bb42
No related branches found
No related tags found
No related merge requests found
...@@ -99,7 +99,7 @@ class MANOCCA: ...@@ -99,7 +99,7 @@ class MANOCCA:
""" """
def __init__(self, predictors, outputs, covariates=None, cols_outputs = None, 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 ### Initializing
self.outputs = outputs self.outputs = outputs
...@@ -127,6 +127,7 @@ class MANOCCA: ...@@ -127,6 +127,7 @@ class MANOCCA:
self.use_resid = use_resid self.use_resid = use_resid
self.use_pca = use_pca self.use_pca = use_pca
self.use_extended = use_extended self.use_extended = use_extended
self.adj_pred = adj_pred
# Filled later # Filled later
self.prodV = None self.prodV = None
...@@ -169,8 +170,9 @@ class MANOCCA: ...@@ -169,8 +170,9 @@ class MANOCCA:
print("computing residuals") print("computing residuals")
print("adjusting outputs") print("adjusting outputs")
self.prodV_red = np.apply_along_axis(lambda x : pt.adjust_covariates(x,covariates), axis = 0, arr = self.prodV_red) self.prodV_red = np.apply_along_axis(lambda x : pt.adjust_covariates(x,covariates), axis = 0, arr = self.prodV_red)
print("adjusting predictor") if self.adj_pred :
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("adjusting predictor") # print("adjusting predictor")
# self.predictors = np.apply_along_axis(lambda x : pt.adjust_covariates(x,covariates), axis = 0, arr = self.predictors) # self.predictors = np.apply_along_axis(lambda x : pt.adjust_covariates(x,covariates), axis = 0, arr = self.predictors)
# print(self.predictors.mean()) # print(self.predictors.mean())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment