Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Framework name fix #54

Merged
merged 7 commits into from
Sep 25, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions src/autogluon_dashboard/utils/dataset_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,26 @@ def get_name_before_first_underscore(df: pandas.DataFrame, col_name: str) -> pan
----------
df: Pandas dataframe,
col_name: str,
Name of Column to perform regex on.
Name of Column to perform filtering on.
"""
return df[col_name].str.extract(r"^(.*?)(?:_|$)")[0]
frame_dict = {}
for index, row in df.iterrows():
if (row[col_name].split('_')[-1] not in frame_dict) and ("AutoGluon" in row[col_name]):
frame_dict[row[col_name].split('_')[-1]] = index

# If there are multiple framework names starting with AutoGluon then rename them in order of timestamp
# To handle benchmark integration case where comparison is between different versions of AutoGluon
if len(frame_dict) > 1:
sorted_items = sorted(frame_dict.items())
earliest_timestamp = sorted_items[0][0]

value_mapping = {earliest_timestamp: 'master'}
for i, (key, value) in enumerate(sorted_items[1:], start=1):
value_mapping[key] = f'PR_{i}'

df[col_name] = df[col_name].apply(lambda x: value_mapping.get(x.split('_')[-1], x))

return df[col_name]


def clean_up_framework_names(df: pandas.DataFrame, dummy: bool = False) -> list:
Expand Down
Loading