-
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
| "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] = valueThere 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 dicts 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 ddThere 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
cf7fd21 to
70e4d4c
Compare
prateekdesai04
left a comment
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_jsonandload_jsonextra_info=True.score_formatargument 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.