CounterfactualExplanations v1.5.0
Version [1.5.0] - 2026-02-14
Breaking
- Public API (should be) unaffected, but some major changes to internal API to comply with new autodiff routines.
Removed
- Temporarily removed tests for NeuroTreeModels.jl pending updates to compat.
- Removed stale dependencies from docs.
Added
- Added a new evaluation measure
feature_sensitivity(ce::AbstractCounterfactualExplanation)that can be used to compute the proposed absolute changes for features. - Added an optional
callback::Union{Nothing,Function}argument togenerate_counterfactualto allow users to either display or store anything relevant from the fullCounterfactualExplanationobject. This is useful if the user has specifiedreturn_flattened=truebut still needs something specific fromCounterfactualExplanationthat is not returned withFlattenedCE.
Changed
- Moved from Flux.jl for autodiff to DifferentiationInterface.jl. Not all backends working for basic examples, but considerable speedup for ForwardDiff compared to Zygote. The following backends work for generic generator:
- Zygote.jl
- ForwardDiff.jl
- PolyesterForwardDiff.jl
- GTPSA.jl
- FiniteDiff.jl
- Symbolics.jl
- Avoid aggregating divergence metrics across runs.
- Changed the way mutability constraints can be supplied: users can now supply a tuple of pairs of feature indices and there corresponding constraints.
- Removed a bug in
reconstruct_cat_encodingthat turned thecounterfactual_stateobject from a matrix into a vector. - Added option to provide additional keyword arguments to
validity_strict(ce::CounterfactualExplanation; kwrgs...). - Small bug fix for
validityfunction. - Improved
find_potential_neighboursmethod. - Added possibility to run
compute_divergencefor a fixed number of samples.
Merged pull requests:
Closed issues:
- New Flux API causing issues (#517)