diff 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
line wrap: on
line diff
--- a/stacking_ensembles.py	Fri Aug 09 06:30:16 2019 -0400
+++ b/stacking_ensembles.py	Mon Dec 16 10:07:37 2019 +0000
@@ -11,7 +11,7 @@
 from sklearn import ensemble
 
 from galaxy_ml.utils import (load_model, get_cv, get_estimator,
-                          get_search_params)
+                             get_search_params)
 
 
 warnings.filterwarnings('ignore')
@@ -82,7 +82,9 @@
 
     weights = options.pop('weights', None)
     if weights:
-        options['weights'] = ast.literal_eval(weights)
+        weights = ast.literal_eval(weights)
+        if weights:
+            options['weights'] = weights
 
     mod_and_name = estimator_type.split('_')
     mod = sys.modules[mod_and_name[0]]