Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
f8c7b84
improved mmd stuff
pat-alt Jan 14, 2025
a2727f0
added default arg
pat-alt Jan 14, 2025
fa0a6f7
small ting
pat-alt Jan 14, 2025
9737d95
uff
pat-alt Jan 14, 2025
228f90b
small ting
pat-alt Jan 14, 2025
8b17735
uh
pat-alt Feb 14, 2025
0dbde63
uff
pat-alt Feb 15, 2025
f5e5143
added optional argument for callback function to generate_counterfactual
pat-alt Feb 16, 2025
3e80328
store :converged field on search dictionary
pat-alt Feb 21, 2025
302bbae
buff
pat-alt Feb 26, 2025
1b21659
removes a small bug related to categorical encodings
pat-alt Mar 11, 2025
5110f64
ok
pat-alt Mar 11, 2025
fd6c12f
remove print statement
pat-alt Mar 11, 2025
a29fb55
Merge branch 'main' into counterfactual-training
pat-alt Mar 11, 2025
d1d3dd0
feature sensitivity measures added
pat-alt Mar 14, 2025
dcb0010
small fix to adjust to new sensitivity metric
pat-alt Mar 14, 2025
54b43a1
uff
pat-alt Mar 14, 2025
14f42ac
improved UI for mutability constraints
pat-alt Jun 30, 2025
38a2514
added option to simply supply vectors of indices of immutable features
pat-alt Jul 1, 2025
dbb7f3c
avoid aggregating divergence across runs
pat-alt Jul 7, 2025
3e916db
formatter
pat-alt Jul 7, 2025
1640554
ok
pat-alt Jul 7, 2025
29d0db0
done
pat-alt Jul 7, 2025
41cf271
adjusted comment in code
pat-alt Jul 15, 2025
9b9bab4
not sure why these tests are not passing
pat-alt Jul 25, 2025
7e95abf
some stuff for the thesis cover page in dev/
pat-alt Jan 21, 2026
a7864bc
updated compats
pat-alt Feb 2, 2026
c4aed5e
moved to DI.jl for auto differentiation
pat-alt Feb 3, 2026
0aa61c3
ok, let's try this
pat-alt Feb 3, 2026
6201f70
fixing errors
pat-alt Feb 3, 2026
073d48f
added option to get/set the global AD backend
pat-alt Feb 3, 2026
0496a59
fixed small error
pat-alt Feb 3, 2026
0506dfb
fixed export
pat-alt Feb 3, 2026
f3f6627
tested a few backends
pat-alt Feb 3, 2026
8e08d25
added loss function extension back in
pat-alt Feb 3, 2026
10fd350
adapted API also for penalty terms of search objective
pat-alt Feb 3, 2026
19478ca
addressing errors
pat-alt Feb 3, 2026
bfa55ef
addressing errors
pat-alt Feb 3, 2026
f15fc5c
addressing errors
pat-alt Feb 3, 2026
1f294f8
addressing errors
pat-alt Feb 3, 2026
e85007a
addressing errors
pat-alt Feb 3, 2026
4d518e7
addressing errors
pat-alt Feb 3, 2026
3cd33a5
addressing errors
pat-alt Feb 3, 2026
fe3ac10
all working except probe, trying FiniteDiff backend
pat-alt Feb 3, 2026
9deefc7
Revert "all working except probe, trying FiniteDiff backend"
pat-alt Feb 4, 2026
c098100
moved things to ForwardDiff
pat-alt Feb 4, 2026
6e3dbd8
addressing errors
pat-alt Feb 4, 2026
0f3d747
trying with Zygote backend again
pat-alt Feb 4, 2026
c981284
trying with Zygote backend again
pat-alt Feb 4, 2026
89f6f33
switching backends dynamically where needed (ProbeGenerator)
pat-alt Feb 4, 2026
3dc7774
LR.jl references removed everywhere
pat-alt Feb 4, 2026
beba867
updated TaijaData
pat-alt Feb 4, 2026
4b550a7
fixed Flux API for generative models
pat-alt Feb 4, 2026
9cca201
migrated to explicit Flux API in GenerativeModels module
pat-alt Feb 5, 2026
f225940
deprecations to tests
pat-alt Feb 5, 2026
cb03a5d
JEM.jl updated
pat-alt Feb 5, 2026
5cba085
fixed issue related to OneHotEncoder in test suite
pat-alt Feb 5, 2026
c61bfad
more updates to deps
pat-alt Feb 5, 2026
3069444
removed NeuroTrees for now
pat-alt Feb 5, 2026
1b8f757
addressing issue with CategoricalValue
pat-alt Feb 5, 2026
dec82d7
attempting to address changes to CategoricalArrays API
pat-alt Feb 6, 2026
3de504a
locally passing on v1.11, checking CI
pat-alt Feb 6, 2026
76de852
tests passing locally (except performance)
pat-alt Feb 6, 2026
2d38e3f
all passing locally in under 15 min on 1.11.8
pat-alt Feb 6, 2026
4f283a8
using ForwardDiff for ECCo
pat-alt Feb 6, 2026
7ef4857
trying all ForwardDiff
pat-alt Feb 6, 2026
812398d
Zygote as default backend; dynamic switching for LaplaceRedux on >= v…
pat-alt Feb 7, 2026
28e33dd
addressing error for when penalty is set to nothing
pat-alt Feb 7, 2026
c9106b5
more work on improving autodiff performance.
pat-alt Feb 13, 2026
0195bae
more work on improving autodiff performance.
pat-alt Feb 13, 2026
a532fcb
fixing issue related to keyword args in penalty
pat-alt Feb 13, 2026
d84d6e2
fixing issue related to mutability
pat-alt Feb 13, 2026
a50efc7
addressing final errors
pat-alt Feb 13, 2026
1179e40
all tests passing, now moving to ForwardDiff as default backend
pat-alt Feb 13, 2026
883e63f
ForwardDiff indeed painfully slow for larger pretrained models
pat-alt Feb 13, 2026
c201de1
adding benchmark tests back
pat-alt Feb 13, 2026
9b3cd06
removed call to ThreadsParallelizer (moved to TaijaParallel)
pat-alt Feb 13, 2026
dd5b947
more tests
pat-alt Feb 13, 2026
87569d0
more tests
pat-alt Feb 13, 2026
0f2e811
more tests
pat-alt Feb 13, 2026
0e76044
more tests
pat-alt Feb 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,35 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),

*Note*: We try to adhere to these practices as of version [v1.1.1].

## Version [1.4.6] - 2026-02-06

### Removed

- Temporarily removed tests for NeuroTreeModels.jl pending updates to compat.
- Temporarily removed tests for benchmarking, which seems non-performant (will open a separate issue).

### 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 to `generate_counterfactual` to allow users to either display or store anything relevant from the full `CounterfactualExplanation` object. This is useful if the user has specified `return_flattened=true` but still needs something specific from `CounterfactualExplanation` that is not returned with `FlattenedCE`.

### 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_encoding` that turned the `counterfactual_state` object from a matrix into a vector.
- Added option to provide additional keyword arguments to `validity_strict(ce::CounterfactualExplanation; kwrgs...)`.
- Small bug fix for `validity` function.
- Improved `find_potential_neighbours` method.
- Added possibility to run `compute_divergence` for a fixed number of samples.

## Version [1.4.5] - 2025-01-13

### Changed
Expand Down
29 changes: 16 additions & 13 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
name = "CounterfactualExplanations"
uuid = "2f13d31b-18db-44c1-bc43-ebaf2cff0be0"
version = "1.5.0"
authors = ["Patrick Altmeyer <p.altmeyer@tudelft.nl> and contributors"]
version = "1.4.5"

[deps]
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
CausalInference = "8e462317-f959-576b-b3c1-403f26cec956"
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DifferentiationInterface = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
EnergySamplers = "f446124b-5d5e-4171-a6dd-a1d99768d3ce"
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
KernelFunctions = "ec8451be-7e33-11e9-00cf-bbf324bd1392"
LazyArtifacts = "4af54fe1-eca0-43a8-85a7-787d91b784e3"
Expand All @@ -20,6 +22,7 @@ MLJBase = "a7f614a8-145f-11e9-1d2a-a57a1082229d"
MLJDecisionTreeInterface = "c6f25543-311c-4c74-83dc-3ea6d1015661"
MLUtils = "f1d291b0-491e-4a28-83b9-f70985020b54"
MultivariateStats = "6f286f6a-111f-5878-ab1e-185364afe411"
Optimisers = "3bd65402-5787-11e9-1adc-39752487f4e2"
PackageExtensionCompat = "65ce6f38-6b18-4e1d-a461-8949797d7930"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Expand All @@ -29,41 +32,42 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
TaijaBase = "10284c91-9f28-4c9a-abbf-ee43576dfff6"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[weakdeps]
DecisionTree = "7806a523-6efd-50cb-b5f6-3fa6f1930dbb"
JointEnergyModels = "48c56d24-211d-4463-bbc0-7a701b291131"
LaplaceRedux = "c52c1a26-f7c5-402b-80be-ba1e638ad478"
NeuroTreeModels = "1db4e0a5-a364-4b0c-897c-2bd5a4a3a1f2"

[extensions]
DecisionTreeExt = "DecisionTree"
JEMExt = "JointEnergyModels"
LaplaceReduxExt = "LaplaceRedux"
NeuroTreeExt = "NeuroTreeModels"

[compat]
Aqua = "0.8"
CategoricalArrays = "0.10"
CausalInference = "0.17, 0.18"
CategoricalArrays = "0.10, 1"
CausalInference = "0.19.2"
ChainRulesCore = "1.15"
DataFrames = "1"
DecisionTree = "0.12.3, 0.12.4"
DifferentiationInterface = "0.7.16"
Distributions = "0.25.97"
EnergySamplers = "1.0"
EnergySamplers = "1"
Flux = "0.12, 0.13, 0.14, 0.15, 0.16"
ForwardDiff = "1.3"
Graphs = "1.11.1"
JointEnergyModels = "0.1.7"
KernelFunctions = "0.10.64"
LaplaceRedux = "0.1.4, 0.2, 1.0"
JointEnergyModels = "0.1, 0.2"
KernelFunctions = "0.10"
LaplaceRedux = "1"
LazyArtifacts = "1"
LinearAlgebra = "1"
Logging = "1"
MLJBase = "0.21, 1"
MLJDecisionTreeInterface = "0.4.0"
MLUtils = "0.2, 0.3, 0.4"
MultivariateStats = "0.9, 0.10"
NeuroTreeModels = "1.1.3"
Optimisers = "0.3, 0.4"
PackageExtensionCompat = "1"
ProgressMeter = "1"
Random = "1"
Expand All @@ -74,15 +78,14 @@ Tables = "1"
TaijaBase = "1"
Test = "1"
UUIDs = "1"
Zygote = "0.6, 0.7"
julia = "1.10"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
DecisionTree = "7806a523-6efd-50cb-b5f6-3fa6f1930dbb"
JointEnergyModels = "48c56d24-211d-4463-bbc0-7a701b291131"
LaplaceRedux = "c52c1a26-f7c5-402b-80be-ba1e638ad478"
NeuroTreeModels = "1db4e0a5-a364-4b0c-897c-2bd5a4a3a1f2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Aqua", "DecisionTree", "JointEnergyModels", "LaplaceRedux", "NeuroTreeModels", "Test"]
test = ["Aqua", "DecisionTree", "JointEnergyModels", "Test"]
26 changes: 13 additions & 13 deletions README_files/figure-commonmark/cell-11-output-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,280 changes: 640 additions & 640 deletions README_files/figure-commonmark/cell-16-output-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
687 changes: 344 additions & 343 deletions README_files/figure-commonmark/cell-3-output-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
168 changes: 85 additions & 83 deletions README_files/figure-commonmark/cell-6-output-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading