|
75 | 75 | FLAGS = flags.FLAGS |
76 | 76 |
|
77 | 77 |
|
78 | | -def get_summary_df(workload, workload_df, include_test_split=False): |
| 78 | +def get_summary_df(workload, workload_df): |
79 | 79 | print(f' WORKLOAD: {workload}') |
80 | 80 | validation_metric, validation_target = ( |
81 | | - scoring_utils.get_workload_metrics_and_targets(workload, split='validation') |
| 81 | + scoring_utils.get_workload_metrics_and_targets(workload) |
82 | 82 | ) |
83 | 83 |
|
84 | 84 | is_minimized = performance_profile.check_if_minimized(validation_metric) |
@@ -145,51 +145,18 @@ def delta(series): |
145 | 145 |
|
146 | 146 | summary_df['step_hint'] = scoring_utils.get_workload_stephint(workload) |
147 | 147 |
|
148 | | - # test metrics |
149 | | - if include_test_split: |
150 | | - test_metric, test_target = scoring_utils.get_workload_metrics_and_targets( |
151 | | - workload, split='test' |
152 | | - ) |
153 | | - |
154 | | - summary_df['test target metric name'] = test_metric |
155 | | - summary_df['test target metric value'] = test_target |
156 | | - |
157 | | - summary_df['test target reached'] = ( |
158 | | - workload_df[test_metric] |
159 | | - .apply(lambda x: target_op(x, test_target)) |
160 | | - .apply(np.any) |
161 | | - ) |
162 | | - summary_df['best metric value on test'] = workload_df[test_metric].apply( |
163 | | - lambda x: best_op(x) |
164 | | - ) |
165 | | - workload_df['index best eval on test'] = workload_df[test_metric].apply( |
166 | | - lambda x: idx_op(x) |
167 | | - ) |
168 | | - summary_df['time to best eval on test (s)'] = workload_df.apply( |
169 | | - lambda x: x['accumulated_submission_time'][x['index best eval on test']], |
170 | | - axis=1, |
171 | | - ) |
172 | | - summary_df['time to target on test (s)'] = summary_df.apply( |
173 | | - lambda x: x['time to best eval on test (s)'] |
174 | | - if x['test target reached'] |
175 | | - else np.inf, |
176 | | - axis=1, |
177 | | - ) |
178 | | - |
179 | 148 | return summary_df |
180 | 149 |
|
181 | 150 |
|
182 | | -def get_submission_summary(df, include_test_split=False): |
| 151 | +def get_submission_summary(df): |
183 | 152 | """Summarizes the submission results into metric and time tables |
184 | 153 | organized by workload. |
185 | 154 | """ |
186 | 155 |
|
187 | 156 | dfs = [] |
188 | 157 | print(df) |
189 | 158 | for workload, group in df.groupby('workload'): |
190 | | - summary_df = get_summary_df( |
191 | | - workload, group, include_test_split=include_test_split |
192 | | - ) |
| 159 | + summary_df = get_summary_df(workload, group) |
193 | 160 | dfs.append(summary_df) |
194 | 161 |
|
195 | 162 | df = pd.concat(dfs) |
|
0 commit comments