From 8602c6ae99abad1dd92b71cc02d71f5cfc8f0950 Mon Sep 17 00:00:00 2001 From: mieskolainen Date: Sat, 19 Oct 2024 21:08:34 +0000 Subject: [PATCH] deploy: 798b113294cee0dea5e9484b1172947af9e142af --- _modules/icenet/tools/process.html | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/_modules/icenet/tools/process.html b/_modules/icenet/tools/process.html index 006a0fbe..0a58b365 100644 --- a/_modules/icenet/tools/process.html +++ b/_modules/icenet/tools/process.html @@ -535,7 +535,6 @@

Source code for icenet.tools.process

 
 from importlib import import_module
 import os
-import copy
 import pickle
 import xgboost
 
@@ -1195,7 +1194,7 @@ 

Source code for icenet.tools.process

         
         with open(os.path.join(cache_directory, f'output_{i}.pkl'), 'rb') as handle:
             X_, Y_, W_, ids, info, genesis_args = pickle.load(handle)
-            
+
             if i > 0:
                 X = np.concatenate((X, X_), axis=0) # awkward will cast numpy automatically
                 Y = np.concatenate((Y, Y_), axis=0)
@@ -1440,7 +1439,7 @@ 

Source code for icenet.tools.process

             output['trn']['data'], imputer = impute_datasets(data=output['trn']['data'], features=impute_vars, args=args['imputation_param'], imputer=None)
             output['val']['data'], imputer = impute_datasets(data=output['val']['data'], features=impute_vars, args=args['imputation_param'], imputer=imputer)
             
-            fmodel = f'{args["modeldir"]}/imputer.pkl'
+            fmodel = os.path.join(args["modeldir"], f'imputer__{args["__hash_post_genesis__"]}.pkl')
             
             print(f'Saving imputer to: {fmodel}', 'green')
             pickle.dump(imputer, open(fmodel, 'wb'), protocol=pickle.HIGHEST_PROTOCOL)
@@ -1451,9 +1450,9 @@ 

Source code for icenet.tools.process

         if args['reweight']:
             
             if args["reweight_file"] is None:
-                fmodel = f'{args["datadir"]}/reweighter_{args["__hash_genesis__"]}.pkl' 
+                fmodel = os.path.join(args["datadir"], f'reweighter__{args["__hash_post_genesis__"]}.pkl') 
             else:    
-                fmodel = f'{args["datadir"]}/{args["reweight_file"]}' 
+                fmodel = os.path.join(args["datadir"], args["reweight_file"]) 
             
             if 'load' in args['reweight_mode']:
                 print(f'Loading reweighting model from: {fmodel} [runmode = {runmode}]', 'green')
@@ -1483,7 +1482,7 @@ 

Source code for icenet.tools.process

         ## Imputate
         if args['imputation_param']['active']:
             
-            fmodel = f'{args["modeldir"]}/imputer.pkl'
+            fmodel = os.path.join(args["modeldir"], f'imputer__{args["__hash_post_genesis__"]}.pkl')
             
             print(f'Loading imputer from: {fmodel}', 'green')
             imputer = pickle.load(open(fmodel, 'rb'))