metrics_helpers#

Helper functions shared between probabilistic and deterministic metrics.

Functions#

equals_zero(number)

Check if a floating-point number is effectively zero, considering floating-point precision.

normalize_by_range(error, y_true, *, ...)

Normalize an error by the range of the true values or by a given norm value.

represented_interval_weights(quantiles)

Calculate the probability interval each quantile represents on [0, 1].

skill_score(score, reference_score, *[, ...])

Calculate the skill of a score relative to a reference score.

weighted_mean_error(errors[, ...])

Calculate the weighted mean of per-sample errors.

Classes#

SampleWeighter(*[, a_min, a_max, exponent])

Weights samples by their magnitude relative to a scale, clipped to [a_min, a_max].