From ce1003ea3000138870069d54d4f7ef90e672a629 Mon Sep 17 00:00:00 2001 From: Priya Kasimbeg Date: Wed, 16 Oct 2024 00:37:08 +0000 Subject: [PATCH] save time to target df in scoring --- scoring/performance_profile.py | 7 +++++-- scoring/score_submissions.py | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/scoring/performance_profile.py b/scoring/performance_profile.py index 32acae9ab..0d5ca9770 100644 --- a/scoring/performance_profile.py +++ b/scoring/performance_profile.py @@ -274,7 +274,8 @@ def compute_performance_profiles(submissions, scale='linear', verbosity=0, strict=False, - self_tuning_ruleset=False): + self_tuning_ruleset=False, + output_dir=None): """Compute performance profiles for a set of submission by some time column. Args: @@ -320,7 +321,9 @@ def compute_performance_profiles(submissions, df = df[BASE_WORKLOADS + HELDOUT_WORKLOADS] # Sort workloads alphabetically (for better display) df = df.reindex(sorted(df.columns), axis=1) - + + # Save time to target dataframe + df.to_csv(os.path.join(output_dir, 'time_to_targets.csv')) # For each held-out workload set to inf if the base workload is inf or nan for workload in df.keys(): if workload not in BASE_WORKLOADS: diff --git a/scoring/score_submissions.py b/scoring/score_submissions.py index 1fb39d193..59295b686 100644 --- a/scoring/score_submissions.py +++ b/scoring/score_submissions.py @@ -210,7 +210,8 @@ def main(_): scale='linear', verbosity=0, self_tuning_ruleset=FLAGS.self_tuning_ruleset, - strict=FLAGS.strict) + strict=FLAGS.strict, + output_dir=FLAGS.output_dir,) if not os.path.exists(FLAGS.output_dir): os.mkdir(FLAGS.output_dir) performance_profile.plot_performance_profiles(