evaluma.metric_registry#
Metric name registry: maps names to optimization direction and natural bounds.
Attributes#
Functions#
|
Return |
|
Return |
|
Return the theoretical error optimum for a known metric name. |
Module Contents#
- evaluma.metric_registry.KNOWN_METRICS#
- evaluma.metric_registry._METRIC_ERROR_OPTIMUM#
- evaluma.metric_registry._KNOWN_LIST = ''#
- evaluma.metric_registry.get_direction(metric_name: str) str#
Return
"min"or"max"for a known metric name.- Parameters:
metric_name – Metric identifier (case-insensitive).
- Returns:
"min"(lower is better) or"max"(higher is better).- Return type:
str
- Raises:
ValueError – If
metric_nameis not in the registry. The message lists all known names and suggests usingmetric_directionfor custom metrics.
- evaluma.metric_registry.get_natural_bounds(metric_name: str) tuple#
Return
(natural_low, natural_high)for a known metric name.natural_highisNonefor unbounded metrics (e.g.rmse,mae), meaning the upper bound must be supplied by the caller.- Parameters:
metric_name – Metric identifier (case-insensitive).
- Returns:
(float, float | None)natural lower and upper bounds.- Return type:
tuple
- Raises:
ValueError – If
metric_nameis not in the registry.
- evaluma.metric_registry.get_error_optimum(metric_name: str) float#
Return the theoretical error optimum for a known metric name.
This is the metric’s perfect-score value in raw score space (
1.0for boundedmaxmetrics andr2,0.0forminmetrics), used to reconstruct raw error independently of normalization bounds.- Parameters:
metric_name – Metric identifier (case-insensitive).
- Returns:
The theoretical optimum score for the metric.
- Return type:
float
- Raises:
ValueError – If
metric_namehas no defined optimum. The message lists all known names and explains the current improvability fallback.