Browse Source

corrected get_n_pipelines_of_each_type in gridsearch, prettyfied

tanja 4 years ago
parent
commit
910392f457

+ 4 - 1
cdplib/gridsearch/GridSearchPipelineSelector.py

@@ -284,7 +284,10 @@ class GridSearchPipelineSelector(PipelineSelector):
                      .sort_values(by=["name", "score"],
                                   ascending=False)\
                      .groupby("name")\
-                     .head(n)[["pipeline"]]
+                     .head(n)\
+                     .groupby("name")["pipeline"]\
+                     .apply(lambda x: list(x))\
+                     .to_dict()
 
         except Exception as e:
             err = ("Failed to retrieve n best trials of each type."

+ 1 - 0
cdplib/hyperopt/HyperoptPipelineSelector.py

@@ -293,6 +293,7 @@ class HyperoptPipelineSelector(PipelineSelector):
             except Exception as e:
                 err = "Failed to retrieve best trial. Exit with error: {}"\
                     .format(e)
+
                 self._logger.log_and_raise_error(err)
 
     @property