|
@@ -457,6 +457,27 @@ class HyperoptPipelineSelector(PipelineSelector):
|
|
|
|
|
|
self._logger.log_and_raise_error(err)
|
|
self._logger.log_and_raise_error(err)
|
|
|
|
|
|
|
|
+ def trials_to_csv(self, path: str = None) -> None:
|
|
|
|
+ """
|
|
|
|
+ Saves an csv file with pipeline names, scores,
|
|
|
|
+ parameters, and timestamps.
|
|
|
|
+ """
|
|
|
|
+ try:
|
|
|
|
+ results = [trial["result"] for trial in self._trials.trials]
|
|
|
|
+
|
|
|
|
+ space_elements = [self._get_space_element_from_trial(trial)
|
|
|
|
+ for trial in self._trials.trials]
|
|
|
|
+
|
|
|
|
+ pd.DataFrame([{**result, **space_element}
|
|
|
|
+ for result, space_element in
|
|
|
|
+ zip(results, space_elements)]).to_csv(path)
|
|
|
|
+
|
|
|
|
+ except Exception as e:
|
|
|
|
+ err = ("Failed to write trials to csv. "
|
|
|
|
+ "Exit with error: {}".format(e))
|
|
|
|
+
|
|
|
|
+ self._logger.log_and_raise_error(err)
|
|
|
|
+
|
|
|
|
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|
|
|
|
|