Quantus
Quantus copied to clipboard
Global and metric-wise config instead of `__init__` args/kwargs
Description of the problem
- Each metric has quite many parameters passed to
__init__. Most of them are shared among all metrics, and play the role of configuration.
Description of a solution
- E.g., PRNG seed can be a global, library config value.
- E.g.,
abs,normalise,return_aggregate,disable_warnings,display_progressbarcould be defined in config class, e.g.,
class MetricConfig(NamedTuple)
abs: bool
normalise: bool
return_aggreagte: bool
disable_warnings: bool
display_progressbar: bool
obviously, some metrics will have their own specialized config classes.
- This could reduce visual complexity of code and misconfiguration caused by an overwhelming number of args and kwargs.
- Alternativelly, we could use pydantic or ml_collections instead of named tuples.