Quantus icon indicating copy to clipboard operation
Quantus copied to clipboard

Global and metric-wise config instead of `__init__` args/kwargs

Open aaarrti opened this issue 2 years ago • 0 comments

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_progressbar could 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.

aaarrti avatar Mar 18 '23 15:03 aaarrti