metrics¶
Validation metrics: reconciliation, channel mass, bootstrap stability.
bootstrap_stability ¶
bootstrap_stability(
fit_fn: Callable[[DataFrame, ndarray, int], Any],
X: DataFrame,
y: ndarray,
X_eval: DataFrame,
*,
n_boot: int = 10,
seed: int = 0
) -> pd.DataFrame
Across-refit SD of per-feature mean channel values (H3 protocol, spec 10.2).
fit_fn(X_boot, y_boot, boot_seed) must return a model consumable by
:class:triadxai.local.TriadExplainer.
Source code in src/triadxai/metrics.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
channel_mass ¶
channel_mass(explanation: TriadExplanation) -> pd.Series
Portfolio share of mean |I|, |D|, |M| (sums to 1).
Source code in src/triadxai/metrics.py
33 34 35 36 37 38 39 | |
reconciliation_error ¶
reconciliation_error(
explanation: TriadExplanation, model: Any, X: DataFrame
) -> float
Max |sum of channels + intercept - model raw score| (C2; 0 by construction).
Source code in src/triadxai/metrics.py
27 28 29 30 | |