Exemplo n.º 1
0
def process_data_shared(**options):
    from csevo.processor.DataProcessor import DataProcessor
    output_dir = options.get("output_dir", Macros.data_dir / "models-data")
    task = options.get("task")
    years = Utils.get_option_as_list(options, "years")
    eval_settings = Utils.get_option_as_list(options, "eval_settings")
    dp = DataProcessor()
    dp.process_shared(output_dir, years, eval_settings, task)
    return
Exemplo n.º 2
0
def make_plots(**options):
    from csevo.Plot import Plot
    which = Utils.get_option_as_list(options, "which")

    plot_maker = Plot()
    plot_maker.make_plots(which, options)
    return
Exemplo n.º 3
0
def make_tables(**options):
    from csevo.Table import Table
    which = Utils.get_option_as_list(options, "which")

    table_maker = Table()
    table_maker.make_tables(which, options)
    return
Exemplo n.º 4
0
 def make_plots(self, which, options: dict):
     for item in which:
         if item == "draft-learning-curve":
             # TODO: outdated (->remove)
             training_log_path = Path(options.get("training-log-path"))
             output_name = options.get("output-name")
             self.make_plot_draft_learning_curve(training_log_path, output_name)
         elif item == "models-results-metrics-dist":
             task = options["task"]
             models = Utils.get_option_as_list(options, "models", self.TASK_2_MODELS.get(task))
             metrics = Utils.get_option_as_list(options, "metrics", self.TASK_2_METRICS.get(task))
             exps = Utils.get_option_as_list(options, "exps", self.EXPS)
             self.plot_models_results_metrics_dist(task, models, metrics, exps)
         elif item == "models-results-variance-dist":
             task = options["task"]
             models = Utils.get_option_as_list(options, "models", self.TASK_2_MODELS.get(task))
             metrics = Utils.get_option_as_list(options, "metrics", self.TASK_2_METRICS.get(task))
             exps = Utils.get_option_as_list(options, "exps", self.EXPS)
             self.plot_models_results_variance_dist(task, models, metrics, exps)
         elif item == "num-data-evolution":
             self.plot_num_data_evolution(
                 Utils.get_option_as_list(options, "years", self.EVO_YEARS),
             )
         else:
             self.logger.warning(f"Unknown plot {item}")
         # end if
     # end for
     return
Exemplo n.º 5
0
def run_models(**options):
    from csevo.ml.TACCRunner import TACCRunner

    work_dir = Path(options.get("work_dir", Macros.data_dir / "models-work"))
    mode = options.get("mode", Macros.train)
    models = Utils.get_option_as_list(options, "models")
    exps = Utils.get_option_as_list(options, "exps")
    trials = Utils.get_option_as_list(options, "trials")
    timeout = options.get("timeout")
    beg = options.get("beg", 0)
    cnt = options.get("cnt", -1)
    local = Utils.get_option_as_boolean(options, "local")
    runner = TACCRunner(work_dir)
    if not local:
        runner.run_models(mode, models, exps, trials, timeout, beg, cnt)
    else:
        runner.run_models_local(mode, models, exps, trials, timeout, beg, cnt)
    return