diff --git a/CHANGELOG.md b/CHANGELOG.md index e7bb0e414..3afdc4534 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ 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.2] - 2025-01-02 + +### Changed + +- Small change to `validity` function: validity is now defined simply as the predicted label corresponding to the target label, independent of the predicted probability. [#508] + ## Version [1.4.2] - 2024-12-31 ### Changed diff --git a/Project.toml b/Project.toml index 9ed3aeec5..550d88d1f 100755 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "CounterfactualExplanations" uuid = "2f13d31b-18db-44c1-bc43-ebaf2cff0be0" authors = ["Patrick Altmeyer and contributors"] -version = "1.4.2" +version = "1.4.3" [deps] CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597" diff --git a/src/evaluation/measures.jl b/src/evaluation/measures.jl index 27ff5ddf6..8d760352b 100644 --- a/src/evaluation/measures.jl +++ b/src/evaluation/measures.jl @@ -6,10 +6,10 @@ include("plausibility/plausibility.jl") """ validity(ce::CounterfactualExplanation; γ=0.5) -Checks of the counterfactual search has been successful with respect to the probability threshold `γ`. In case multiple counterfactuals were generated, the function returns the proportion of successful counterfactuals. +Checks of the counterfactual search has been successful in that the predicted label corresponds to the specified target. In case multiple counterfactuals were generated, the function returns the proportion of successful counterfactuals. """ function validity(ce::CounterfactualExplanation; agg=Statistics.mean, γ=0.5) - val = agg(CounterfactualExplanations.target_probs(ce) .>= γ) + val = agg(CounterfactualExplanations.counterfactual_label(ce) .== ce.target) val = val isa LinearAlgebra.AbstractMatrix ? vec(val) : val return val end