Compute average performance of models over all tasks#71
Open
imenelydiaker wants to merge 7 commits intomainfrom
Open
Compute average performance of models over all tasks#71imenelydiaker wants to merge 7 commits intomainfrom
imenelydiaker wants to merge 7 commits intomainfrom
Conversation
…//github.com/Lyon-NLP/mtebscripts into 69-get-models-performance-on-other-languages
| @@ -0,0 +1,73 @@ | |||
| import os | |||
There was a problem hiding this comment.
modify file name => compute_average_performance instead of avergae
| format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", | ||
| ) | ||
|
|
||
|
|
There was a problem hiding this comment.
more elegant way : use os.path.basename(model_name) will return the last part of a path (the model name)
| new_df.insert(0, "overall_avg", overall_avg) | ||
|
|
||
| new_df.reset_index(inplace=True) | ||
| models_short_name = new_df.model.apply(lambda x: models_name_to_index[x]) |
There was a problem hiding this comment.
I think you can simplify code and avoid storing the index mapping, then computing on a new dataframe, then reseting the index. You can compute directly averages on level 0, and change the columns name by prefixing with "avg_"
# Compute average on each task type
averaged_df = result_df.T.groupby(level=0).mean().T
# change column names by prefixing with "avg_"
averaged_df.columns = [f"avg_{col.lower()}" for col in averaged_df.columns]
# compute overall average
averaged_df.insert(0, "avg_overall", averaged_df.mean(axis=1))
# only keep model name in path
averaged_df.index = averaged_df.index.map(os.path.basename)…//github.com/Lyon-NLP/mtebscripts into 69-get-models-performance-on-other-languages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All in a CSV file:
Note:
model_shortcolumn is the model name without the prefix