diff train_test_eval.py @ 2:38c4f8a98038 draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 5b2ac730ec6d3b762faa9034eddd19ad1b347476"
author bgruening
date Mon, 16 Dec 2019 10:07:37 +0000
parents c1b0c8232816
children 0a1812986bc3
line wrap: on
line diff
--- a/train_test_eval.py	Fri Aug 09 06:30:16 2019 -0400
+++ b/train_test_eval.py	Mon Dec 16 10:07:37 2019 +0000
@@ -2,6 +2,7 @@
 import joblib
 import json
 import numpy as np
+import os
 import pandas as pd
 import pickle
 import warnings
@@ -29,8 +30,9 @@
 setattr(_search, '_fit_and_score', _fit_and_score)
 setattr(_validation, '_fit_and_score', _fit_and_score)
 
-N_JOBS = int(__import__('os').environ.get('GALAXY_SLOTS', 1))
-CACHE_DIR = './cached'
+N_JOBS = int(os.environ.get('GALAXY_SLOTS', 1))
+CACHE_DIR = os.path.join(os.getcwd(), 'cached')
+del os
 NON_SEARCHABLE = ('n_jobs', 'pre_dispatch', 'memory', '_path',
                   'nthread', 'callbacks')
 ALLOWED_CALLBACKS = ('EarlyStopping', 'TerminateOnNaN', 'ReduceLROnPlateau',
@@ -403,7 +405,6 @@
             del main_est.validation_data
             if getattr(main_est, 'data_generator_', None):
                 del main_est.data_generator_
-                del main_est.data_batch_generator
 
         with open(outfile_object, 'wb') as output_handler:
             pickle.dump(estimator, output_handler,