AxoBench API

IRon relevance

Signatures, parameters, return values, and source for iRon relevance.

Overview

The relevance function and squared error-relevance area of the IRon R package (Ribeiro and Moniz, 2020) with its default settings: adjusted-boxplot fences (Hubert and Vandervieren, 2008) with an exact medcouple, relevance 1 at the fences and 0 at the median, and a trapezoidal area over thresholds with step 0.001.

Source revision: 496e0c1a2dfd. Export index.

iron_relevance

axobench.relevance.iron_relevance(target: np.ndarray, *, reference: np.ndarray | None=None) -> np.ndarray

Source

IRon default relevance phi of each value, with control points from the reference values: 1 at the lower adjusted-boxplot fence, 0 at the median, 1 at the upper fence, monotone cubic in between and constant beyond.

Parameters

target np.ndarray
required. Values to score.
reference np.ndarray | None
keyword-only, default=None. Values that define the control points; None uses target.

Returns

relevance np.ndarray
Relevance in [0, 1] with the shape of target.

iron_threshold_weights

axobench.relevance.iron_threshold_weights(relevance: np.ndarray, *, step: float=0.001) -> np.ndarray

Source

Per-sample weights A(phi) such that iron_sera(e, phi) equals the sum of e**2 * A(phi): the trapezoidal area of the thresholds a sample passes, and 1 for phi >= 1.

Parameters

relevance np.ndarray
required. Relevance values.
step float
keyword-only, default=0.001. Threshold grid step.

Returns

weights np.ndarray
Weights in [0, 1].

iron_sera

axobench.relevance.iron_sera(error: np.ndarray, relevance: np.ndarray, *, step: float=0.001) -> float

Source

IRon sera: the trapezoidal area over thresholds t of SER(t), the summed squared error of samples with relevance at least t.

Parameters

error np.ndarray
required. Prediction errors.
relevance np.ndarray
required. Relevance of each sample.
step float
keyword-only, default=0.001. Threshold grid step.

Returns

sera float
Squared error-relevance area, not normalized.

adjusted_box_fences

axobench.relevance.adjusted_box_fences(values: np.ndarray, *, coef: float=1.5, a: float=-4.0, b: float=3.0) -> tuple[float, float, float]

Source

Lower fence, median, and upper fence of the adjusted boxplot, as robustbase::adjboxStats: Q1 - coef exp(a mc) IQR and Q3 + coef exp(b mc) IQR for mc >= 0, mirrored for mc < 0.

Parameters

values np.ndarray
required. Sample values; flattened.
coef float
keyword-only, default=1.5. Whisker coefficient.
a float
keyword-only, default=-4.0. Lower exponent coefficient.
b float
keyword-only, default=3.0. Upper exponent coefficient.

Returns

fences tuple[float, float, float]
(lower fence, median, upper fence).

medcouple

axobench.relevance.medcouple(values: np.ndarray) -> float

Source

Exact medcouple, a robust skewness measure (Brys, Hubert and Struyf, 2004), computed in O(n log n).

Parameters

values np.ndarray
required. Sample values; flattened.

Returns

mc float
Medcouple in [-1, 1]; 0 for fewer than three values or zero spread.

fivenum

axobench.relevance.fivenum(values: np.ndarray) -> np.ndarray

Source

Tukey’s five-number summary, as R’s fivenum.

Parameters

values np.ndarray
required. Sample values; flattened. At least one is required.

Returns

summary np.ndarray
Minimum, lower hinge, median, upper hinge, and maximum.

Search guides, examples, and API signatures.