Repository navigation
v0.2.0
Correctness release; the numerical claims below are enforced by tests
against exact refitting or brute-force enumeration.
Breaking changes
- Fairness
explainaudit arguments are keyword-only. viz.plot_heatmapno longer acceptscluster=.BanzhafInfluencereturns NaN (with a warning) instead of 0.0 for
training points whose subset refits all fail.InfluenceFunctionsrejects configurations it cannot represent
(class_weight, l1/elasticnet penalties) instead of returning
degraded scores;influence(method='auto')falls back with a
warning.removal_curverequiresmode='loss'.- Labels outside
model.classes_raise instead of being mapped to the
negative class. - viz requires matplotlib >= 3.9.
Fixed
- Binary label encodings other than {0,1} produced incorrect scores for
LogisticRegression(train- and test-side NLL gradients used raw
label values). Scores are now invariant across {0,1}, {1,2}, {-1,+1},
and string encodings; the same fix applies to the fairness closed
form. - Fairness
eoppandfprwere swapped for non-{0,1} encodings
(conditioning on the literal value 1 instead of the model's positive
class);disparity_value_hard's worst-group error compared decisions
against raw labels. - NaN scores corrupted the analysis utilities (
top_influentialranked
NaN as most helpful; a single NaN emptiedfind_mislabeledand
poisonedinfluence_summary/compare_attributors). All utilities
and plots exclude NaN from rankings and statistics, with a warning. - Small-subset sampling bias in
BanzhafInfluence(subsets of size one
were excluded from Monte-Carlo sampling). disparity_removal_curvereported the wrongbase_disparitywhen
fractionsdid not start at 0.- Clear early errors replace cryptic failures for sparse inputs,
multi-output targets, unfitted models passed to refit-based
attributors, multiclass classifiers withoutpredict_proba, and
wrapped estimators undermethod='auto'. KernelRidgewith a callable kernel failed, andkernel_paramswas
ignored; the kernel reconstruction now mirrors scikit-learn's.liblinear-solver logistic models trigger a warning (the regularized
intercept violates the Hessian assumption).
Added
- Custom fairness metrics via callables, with analytic or
finite-difference gradients in the closed form; bundledcohens_d. - Monte-Carlo standard errors:
BanzhafInfluenceand
BootstrapInfluenceexposescores_std_;
viz.plot_top_influencers(..., xerr=...)draws error bars. - New plots:
plot_disparity_curve,plot_detection_curve,
plot_influence_concentration. stability_replicatesutility feedingplot_top_k_stability.supports(model): capability check forInfluenceFunctionsthat
never raises or warns.self_influencecomputes the diagonal directly for
InfluenceFunctions, LOOInfluence, and BootstrapInfluence (O(n) memory
instead of the full matrix).- README figures and an explicit limitations section.