def save_results_as_csv(self):
     FileOperations.save_file_with_fallback(
         save_method_or_function=self._write_results_to_csv_file,
         filename=FileOperations.apply_extension_to_filename(
             original_filename=self.save_file_name, file_extension='.csv'),
         fallback_filename=FileOperations.apply_extension_to_filename(
             original_filename=DefaultFilenames.SAVE_FALLBACK,
             file_extension='.csv'))
예제 #2
0
    def save(self, filename=DefaultFilenames.MODEL_FILENAME):
        filename_with_extension = FileOperations.apply_extension_to_filename(
            original_filename=filename,
            file_extension=self.file_extension
        )

        FileOperations.save_file_with_fallback(
            save_method_or_function=self._dump_model_to_file_with_pickle,
            filename=filename_with_extension,
            fallback_filename=FileOperations.apply_extension_to_filename(
                original_filename=DefaultFilenames.MODEL_FALLBACK,
                file_extension=self.file_extension
            )
        )
예제 #3
0
    def save_results_boxplot(self, results_data_category, filename):
        PlotOperations.initialize_figure()
        self._add_default_boxplot_graph_settings()
        results_data = self._determine_results_data(results_data_category)
        labels = self._determine_plot_labels(results_data_category)
        filename_with_extension = FileOperations.apply_extension_to_filename(
            original_filename=filename, file_extension='.png')

        self._queue_boxplots(results_data, labels)
        FileOperations.save_file_with_fallback(
            save_method_or_function=PlotOperations.save_plots,
            filename=filename_with_extension,
            fallback_filename=FileOperations.apply_extension_to_filename(
                original_filename=DefaultFilenames.PLOT_FALLBACK,
                file_extension='.png'))
    def save_plots(filename):
        if(PlotOperations.figure is None):
            PlotOperations.initialize_figure()

        filename_with_extension = FileOperations.apply_extension_to_filename(
            original_filename=filename,
            file_extension='.png'
        )
        PlotOperations._plot_queued_plots()
        plt.savefig(filename_with_extension, bbox_inches='tight')
        plt.close(PlotOperations.figure)

        PlotOperations.figure = None
        PlotOperations.clear_queued_plots()
 def __init__(
     self,
     evaluation_number,
     model_number
 ):
     self.evaluation_number = evaluation_number
     self.model_number = model_number
     self.results = None
     self.results_filename = FileOperations.apply_extension_to_filename(
         original_filename=DefaultFilenames.evaluation_results_filename(
             evaluation_number=evaluation_number
         ),
         file_extension='.csv'
     )