コード例 #1
0
 def on_run_start(self):
     content = ""
     content += format_fold_run(fold=self._fold, run=self._run)
     content += format(self.log_separator if content != "" and self.current_seed else "")
     content += "Seed: {}".format(self.current_seed) if self.current_seed else ""
     G.log(content, previous_frame=inspect.currentframe().f_back, add_time=True)
     super().on_run_start()
コード例 #2
0
    def on_run_end(self):
        content = list()
        content.append(format_fold_run(fold=self._fold, run=self._run))
        content.append(format_evaluation_results(self.last_evaluation_results, float_format=self.float_format))
        content.append('Time Elapsed: {}'.format(sec_to_hms(self.stat_aggregates['times']['runs'][-1], as_str=True)))

        G.log(self.log_separator.join(content), previous_frame=inspect.currentframe().f_back)
        super().on_run_end()
コード例 #3
0
    def on_repetition_end(self):
        content = format_fold_run(rep=self._rep, fold="-", run="-")
        content += self.log_separator if not content.endswith(" ") else ""
        content += format_evaluation(self.last_evaluation_results,
                                     float_format=self.float_format)
        content += self.log_separator if not content.endswith(" ") else ""
        content += self.__elapsed_helper("reps")

        if G.Env.verbose >= 2 and G.Env.cv_params.get("n_repeats", 1) > 1:
            G.log(content, previous_frame=inspect.currentframe().f_back)
        else:
            G.debug(content, previous_frame=inspect.currentframe().f_back)
        super().on_repetition_end()
コード例 #4
0
    def on_run_end(self):
        content = [
            format_fold_run(rep=self._rep, fold=self._fold, run=self._run),
            format_evaluation(self.last_evaluation_results,
                              float_format=self.float_format),
            self.__elapsed_helper("runs"),
        ]

        if G.Env.verbose >= 3 and G.Env.runs > 1:
            G.log(self.log_separator.join(content),
                  previous_frame=inspect.currentframe().f_back)
        else:
            G.debug(self.log_separator.join(content),
                    previous_frame=inspect.currentframe().f_back)
        super().on_run_end()
コード例 #5
0
    def on_fold_end(self):
        content = format_fold_run(rep=self._rep, fold=self._fold, run="-")
        content += self.log_separator if not content.endswith(" ") else ""
        content += format_evaluation(self.last_evaluation_results,
                                     float_format=self.float_format)
        content += self.log_separator if not content.endswith(" ") else ""
        content += self.__elapsed_helper("folds")

        if G.Env.verbose >= 2 and G.Env.cv_params["n_splits"] > 1:
            G.log(content,
                  previous_frame=inspect.currentframe().f_back,
                  add_time=False)
        else:
            G.debug(content,
                    previous_frame=inspect.currentframe().f_back,
                    add_time=False)
        super().on_fold_end()
コード例 #6
0
    def on_run_start(self):
        content = format_fold_run(rep=self._rep,
                                  fold=self._fold,
                                  run=self._run)
        content += format(
            self.log_separator if content != "" and self.current_seed else "")
        content += "Seed: {}".format(
            self.current_seed) if self.current_seed else ""

        if G.Env.verbose >= 4 and G.Env.runs > 1:
            G.log(content,
                  previous_frame=inspect.currentframe().f_back,
                  add_time=True)
        else:
            G.debug(content,
                    previous_frame=inspect.currentframe().f_back,
                    add_time=True)
        super().on_run_start()