Closed mpariente closed 4 years ago
I think in general, your idea is good.
Do you have a particular use case in mind where you need to switch between which metrics you need frequently?
In my own experiments I tend to calculate all metrics and then decide later, e.g., when writing the report, which metrics are required.
An alternative is to implement everything as an item getter (more Pythonic, less Javaesque):
result = {k: metric[k] for k in metric_names}
I think that reads good on your side and can be implemented with less redundant code internally. Would you be fine with that?
Thanks for your answer.
Do you have a particular use case in mind where you need to switch between which metrics you need frequently?
No actually, they'll always stay the same among one script. I can write the dictionary by hand in the given script and call it. I just thought it might be good to make it a built-in function. If you're willing to implement it, you're the best person to decide how to do it ! :wink:
Hi,
Both
InputMetrics
andOutputMetrics
have theas_dict
function which returns all the metrics as a dict. I think this is a nice UI but it would be even nicer to be able to control which metric is going to be computed without calling them one by one, what do you think?Something like this might do, with more
I'm willing to put more efforts into it if you'd be interested of course.