Skip to content

Commit

Permalink
Update amlb/benchmark.py
Browse files Browse the repository at this point in the history
Co-authored-by: Pieter Gijsbers <p.gijsbers@tue.nl>
  • Loading branch information
Innixma and PGijsbers authored Nov 3, 2024
1 parent 53691db commit 1121ca4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions amlb/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,12 +334,11 @@ def _in_job_history(self, task_def, fold):

@staticmethod
def _validate_job_history(job_history):
required_columns = ['framework', 'constraint', 'id', 'fold']
actual_columns = list(job_history.columns)
for c in required_columns:
if c not in actual_columns:
raise AssertionError(f'job_history missing required column "{c}"! '
f'Columns: {actual_columns}')
required_columns = {'framework', 'constraint', 'id', 'fold'}
actual_columns = set(job_history.columns)
if missing_columns := (required_columns - actual_columns):
quoted_columns = ', '.join(repr(c) for c in missing_columns)
raise AssertionError(f'job_history missing required column(s) {quoted_columns}! ')

def _skip_job(self, task_def, fold):
if fold < 0 or fold >= task_def.folds:
Expand Down

0 comments on commit 1121ca4

Please sign in to comment.