MODULE REFERENCE
utils
anomx.metrics.utilsMetric Utils
classification_support
classification_support(func) -> Callable[..., METRIC_OUTPUT_TYPE]This decorator adds support for classification metrics including sanity checks and handling of class probabilities and categorical samples.
| Parameter | Type | Default |
|---|---|---|
func | — | required |
Returns Callable[..., METRIC_OUTPUT_TYPE]
interval_support
interval_support(func) -> Callable[..., METRIC_OUTPUT_TYPE]This decorator adds support for quantile interval metrics with sanity checks, processing, and extraction of quantiles from the intervals.
| Parameter | Type | Default |
|---|---|---|
func | — | required |
Returns Callable[..., METRIC_OUTPUT_TYPE]
multi_ts_support
multi_ts_support(func) -> Callable[..., METRIC_OUTPUT_TYPE]This decorator further adapts the metrics that took as input two (or three for scaled metrics with insample) univariate/multivariate TimeSeries instances, adding support for equally-sized sequences of TimeSeries instances. The decorator computes the pairwise metric for TimeSeries with the same indices, and returns a float value that is computed as a function of all the pairwise metrics using a series_reduction subroutine passed as argument to the metric function.
If a 'Sequence[TimeSeries]' is passed as input, this decorator provides also parallelisation of the metric evaluation regarding different TimeSeries (if the n_jobs parameter is not set 1).
| Parameter | Type | Default |
|---|---|---|
func | — | required |
Returns Callable[..., METRIC_OUTPUT_TYPE]
multivariate_support
multivariate_support(func) -> Callable[..., METRIC_OUTPUT_TYPE]This decorator transforms a metric function that takes as input two univariate TimeSeries instances into a function that takes two equally-sized multivariate TimeSeries instances, computes the pairwise univariate metrics for components with the same indices, and returns a float value that is computed as a function of all the univariate metrics using a component_reduction subroutine passed as argument to the metric function.
| Parameter | Type | Default |
|---|---|---|
func | — | required |
Returns Callable[..., METRIC_OUTPUT_TYPE]
register_metric_callback
register_metric_callback(callback: Callable) -> NoneRegister a callback to be invoked after every top-level metric call.
| Parameter | Type | Default |
|---|---|---|
callback | Callable | required |
Returns None
unregister_metric_callback
unregister_metric_callback(callback: Callable) -> NoneRemove a previously registered metric callback, if present.
| Parameter | Type | Default |
|---|---|---|
callback | Callable | required |
Returns None
COMP_AX
COMP_AX = 1METRIC_OUTPUT_TYPE
METRIC_OUTPUT_TYPE = float | list[float] | np.ndarray | list[np.ndarray]METRIC_TYPE
METRIC_TYPE = Callable[..., METRIC_OUTPUT_TYPE]PROBA_SUFFIX
PROBA_SUFFIX = '_p'SMPL_AX
SMPL_AX = 2TIME_AX
TIME_AX = 0