Metric
- class Metric[source]
Bases:
ExtraReprMixin
A base class for metrics.
Attributes Summary
whether the metric needs binarized scores
whether there is a closed-form solution of the expectation
whether there is a closed-form solution of the variance
Return the key for use in metric result dictionaries.
whether the metric supports weights
synonyms for this metric
Methods Summary
Generate the extra repr, cf.
Get the description.
get_link
()Get the link from the docdata.
Get the math notation for the range of this metric.
Iterate over the components of the
extra_repr()
.Attributes Documentation
- closed_expectation: ClassVar[bool] = False
whether there is a closed-form solution of the expectation
- key
Return the key for use in metric result dictionaries.
- synonyms: ClassVar[Collection[str]] = ()
synonyms for this metric
Methods Documentation
- classmethod get_range() str [source]
Get the math notation for the range of this metric.
- Return type:
- iter_extra_repr() Iterable[str]
Iterate over the components of the
extra_repr()
.This method is typically overridden. A common pattern would be
def iter_extra_repr(self) -> Iterable[str]: yield from super().iter_extra_repr() yield "<key1>=<value1>" yield "<key2>=<value2>"
- Returns:
an iterable over individual components of the
extra_repr()
- Return type: