-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add get_simulation_artifact #3555
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
Add get_simulation_artifact #3555
Conversation
Job PR-3555-e3257b1 is done. |
"label", # The label column name | ||
""" | ||
aggregated_pred_proba = {} | ||
aggregated_ground_truth = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe with defaultdict
we could get rid of the extra checks below?
from collections import defaultdict
def recursive_dd():
return defaultdict(recursive_dd)
aggregated_pred_proba = recursive_dd()
# we can now assign aggregated_pred_proba[task_name][fold][key][model] = value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also optionally convert the output back to regular dict
s with
def dd_to_dict(dd):
dd = dict(dd)
for k, v in dd.items():
if isinstance(v, defaultdict):
dd[k] = dd_to_dict(v)
return dd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! Updated to use defaultdict
ff47f8b
to
30d0820
Compare
c816933
to
7099ac1
Compare
9a82ca2
to
882b200
Compare
Job PR-3555-9a82ca2 is done. |
Job PR-3555-882b200 is done. |
cf7fd21
to
70e4d4c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Issue #, if available:
Description of changes:
save_json
andload_json
extra_info=True
.score_format
argument to leaderboard to add the option to return the error instead of the score.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.