evaluma.metric_registry
=======================

.. py:module:: evaluma.metric_registry

.. autoapi-nested-parse::

   Metric name registry: maps names to optimization direction and natural bounds.



Attributes
----------

.. autoapisummary::

   evaluma.metric_registry.KNOWN_METRICS
   evaluma.metric_registry._KNOWN_LIST


Functions
---------

.. autoapisummary::

   evaluma.metric_registry.get_direction
   evaluma.metric_registry.get_natural_bounds


Module Contents
---------------

.. py:data:: KNOWN_METRICS

.. py:data:: _KNOWN_LIST
   :value: ''


.. py:function:: get_direction(metric_name: str) -> str

   Return ``"min"`` or ``"max"`` for a known metric name.

   :param metric_name: Metric identifier (case-insensitive).

   :returns: ``"min"`` (lower is better) or ``"max"`` (higher is better).
   :rtype: str

   :raises ValueError: If ``metric_name`` is not in the registry. The message
       lists all known names and suggests using ``metric_direction`` for
       custom metrics.


.. py:function:: get_natural_bounds(metric_name: str) -> tuple

   Return ``(natural_low, natural_high)`` for a known metric name.

   ``natural_high`` is ``None`` for unbounded metrics (e.g. ``rmse``, ``mae``),
   meaning the upper bound must be supplied by the caller.

   :param metric_name: Metric identifier (case-insensitive).

   :returns: ``(float, float | None)`` natural lower and upper bounds.
   :rtype: tuple

   :raises ValueError: If ``metric_name`` is not in the registry.


