comparison stacking_ensembles.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
comparison
equal deleted inserted replaced
1:c1b0c8232816 2:38c4f8a98038
9 import sys 9 import sys
10 import warnings 10 import warnings
11 from sklearn import ensemble 11 from sklearn import ensemble
12 12
13 from galaxy_ml.utils import (load_model, get_cv, get_estimator, 13 from galaxy_ml.utils import (load_model, get_cv, get_estimator,
14 get_search_params) 14 get_search_params)
15 15
16 16
17 warnings.filterwarnings('ignore') 17 warnings.filterwarnings('ignore')
18 18
19 N_JOBS = int(__import__('os').environ.get('GALAXY_SLOTS', 1)) 19 N_JOBS = int(__import__('os').environ.get('GALAXY_SLOTS', 1))
80 # set n_jobs 80 # set n_jobs
81 options['n_jobs'] = N_JOBS 81 options['n_jobs'] = N_JOBS
82 82
83 weights = options.pop('weights', None) 83 weights = options.pop('weights', None)
84 if weights: 84 if weights:
85 options['weights'] = ast.literal_eval(weights) 85 weights = ast.literal_eval(weights)
86 if weights:
87 options['weights'] = weights
86 88
87 mod_and_name = estimator_type.split('_') 89 mod_and_name = estimator_type.split('_')
88 mod = sys.modules[mod_and_name[0]] 90 mod = sys.modules[mod_and_name[0]]
89 klass = getattr(mod, mod_and_name[1]) 91 klass = getattr(mod, mod_and_name[1])
90 92