acfx 0.3.6.dev3__tar.gz → 0.3.7.dev0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/PKG-INFO +16 -14
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/acfx/evaluation/ccfs.py +4 -2
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/acfx.egg-info/PKG-INFO +16 -14
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/acfx.egg-info/requires.txt +3 -3
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/pyproject.toml +23 -25
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/LICENSE +0 -0
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/acfx/ACFX.py +0 -0
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/acfx/AcfxCustom.py +0 -0
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/acfx/AcfxEBM.py +0 -0
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/acfx/AcfxLinear.py +0 -0
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/acfx/RandomSearchCounterOptimizer.py +0 -0
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/acfx/__init__.py +0 -0
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/acfx/abstract/ModelBasedCounterOptimizer.py +0 -0
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/acfx/abstract/OptimizerType.py +0 -0
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/acfx/abstract/__init__.py +0 -0
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/acfx/evaluation/EBMCounterOptimizer.py +0 -0
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/acfx/evaluation/LogisticRegressionCounterOptimizer.py +0 -0
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/acfx/evaluation/__init__.py +0 -0
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/acfx/evaluation/bayesian_model.py +0 -0
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/acfx/evaluation/loss.py +0 -0
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/acfx/evaluation/multi_dataset_evaluation.py +0 -0
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/acfx/evaluation/utils.py +0 -0
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/acfx.egg-info/SOURCES.txt +0 -0
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/acfx.egg-info/dependency_links.txt +0 -0
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/acfx.egg-info/top_level.txt +0 -0
- {acfx-0.3.6.dev3 → acfx-0.3.7.dev0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: acfx
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.7.dev0
|
|
4
4
|
Summary: Actionable Counterfactual eXplanations
|
|
5
5
|
Author-email: Szymon Bobek <szymon.bobek@gmail.com>, Piotr Kubacki <piotr.kubacki00@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -9,6 +9,8 @@ Project-URL: Documentation, https://acfx.readthedocs.org
|
|
|
9
9
|
Project-URL: Issues, https://github.com/sbobek/acfx/issues
|
|
10
10
|
Keywords: xai,tabular data,explainability,model-agnostic,counterfactual,causal
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
14
|
Classifier: Operating System :: OS Independent
|
|
13
15
|
Requires-Python: >=3.10
|
|
14
16
|
Description-Content-Type: text/markdown
|
|
@@ -16,9 +18,9 @@ License-File: LICENSE
|
|
|
16
18
|
Requires-Dist: numpy==1.26.0; python_version < "3.12"
|
|
17
19
|
Requires-Dist: numpy<=2.4.3,>=1.26.0; python_version >= "3.12"
|
|
18
20
|
Requires-Dist: pandas==1.5.3; python_version < "3.12"
|
|
19
|
-
Requires-Dist: pandas<=2.3
|
|
21
|
+
Requires-Dist: pandas<=2.4.3,>=1.5.3; python_version >= "3.12"
|
|
20
22
|
Requires-Dist: scipy==1.11.4; python_version < "3.12"
|
|
21
|
-
Requires-Dist: scipy<1.17,>=1.11.
|
|
23
|
+
Requires-Dist: scipy<1.17,>=1.11.4; python_version >= "3.12"
|
|
22
24
|
Requires-Dist: scikit-learn==1.6.1; python_version < "3.12"
|
|
23
25
|
Requires-Dist: scikit-learn<=1.8.0,>=1.6.1; python_version >= "3.12"
|
|
24
26
|
Requires-Dist: optuna==4.2.0
|
|
@@ -27,17 +29,17 @@ Requires-Dist: interpret==0.7.3
|
|
|
27
29
|
Requires-Dist: interpret-core==0.7.3
|
|
28
30
|
Requires-Dist: overrides==7.4.0
|
|
29
31
|
Provides-Extra: benchmark
|
|
30
|
-
Requires-Dist: tensorflow==2.14.0; python_version
|
|
31
|
-
Requires-Dist: lingam==1.9.1; python_version
|
|
32
|
-
Requires-Dist: openml==0.15.1; python_version
|
|
33
|
-
Requires-Dist: alibi==0.9.6; python_version
|
|
34
|
-
Requires-Dist: lux-explainer==1.3.2; python_version
|
|
35
|
-
Requires-Dist: networkx==3.4.2; python_version
|
|
36
|
-
Requires-Dist: cfnow==0.0.6; python_version
|
|
37
|
-
Requires-Dist: dice-ml==0.11; python_version
|
|
38
|
-
Requires-Dist: pydotplus==2.0.2; python_version
|
|
39
|
-
Requires-Dist: deap==1.4.2; python_version
|
|
40
|
-
Requires-Dist: pydot==3.0.4; python_version
|
|
32
|
+
Requires-Dist: tensorflow==2.14.0; python_version <= "3.11" and extra == "benchmark"
|
|
33
|
+
Requires-Dist: lingam==1.9.1; python_version <= "3.11" and extra == "benchmark"
|
|
34
|
+
Requires-Dist: openml==0.15.1; python_version <= "3.11" and extra == "benchmark"
|
|
35
|
+
Requires-Dist: alibi==0.9.6; python_version <= "3.11" and extra == "benchmark"
|
|
36
|
+
Requires-Dist: lux-explainer==1.3.2; python_version <= "3.11" and extra == "benchmark"
|
|
37
|
+
Requires-Dist: networkx==3.4.2; python_version <= "3.11" and extra == "benchmark"
|
|
38
|
+
Requires-Dist: cfnow==0.0.6; python_version <= "3.11" and extra == "benchmark"
|
|
39
|
+
Requires-Dist: dice-ml==0.11; python_version <= "3.11" and extra == "benchmark"
|
|
40
|
+
Requires-Dist: pydotplus==2.0.2; python_version <= "3.11" and extra == "benchmark"
|
|
41
|
+
Requires-Dist: deap==1.4.2; python_version <= "3.11" and extra == "benchmark"
|
|
42
|
+
Requires-Dist: pydot==3.0.4; python_version <= "3.11" and extra == "benchmark"
|
|
41
43
|
Provides-Extra: streamlit-app
|
|
42
44
|
Requires-Dist: streamlit==1.48.0; extra == "streamlit-app"
|
|
43
45
|
Requires-Dist: streamlit-sortables==0.3.1; extra == "streamlit-app"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import random
|
|
2
|
+
import uuid
|
|
2
3
|
from typing import Sequence, Dict, Tuple, Optional, List
|
|
3
4
|
import traceback
|
|
4
5
|
import numpy as np
|
|
@@ -29,7 +30,7 @@ def __generate_single_cf(query_instance, desired_class, adjacency_matrix, causal
|
|
|
29
30
|
|
|
30
31
|
def update_masked_features_dict(features_order, masked_features, **params):
|
|
31
32
|
qi = query_instance
|
|
32
|
-
if (1,features_order) == query_instance.shape:
|
|
33
|
+
if (1,len(features_order)) == query_instance.shape:
|
|
33
34
|
qi = query_instance.flatten()
|
|
34
35
|
for feature, value in zip(features_order, qi):
|
|
35
36
|
if feature not in masked_features:
|
|
@@ -82,7 +83,8 @@ def __generate_single_cf(query_instance, desired_class, adjacency_matrix, causal
|
|
|
82
83
|
return -loss[0, 1]
|
|
83
84
|
|
|
84
85
|
# Initialize Optuna study
|
|
85
|
-
|
|
86
|
+
study_name = f"study_{uuid.uuid4().hex}"
|
|
87
|
+
study = optuna.create_study(direction='maximize', storage=None, study_name=study_name)
|
|
86
88
|
|
|
87
89
|
# Define seen_points set to track uniqueness of points
|
|
88
90
|
seen_points = set()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: acfx
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.7.dev0
|
|
4
4
|
Summary: Actionable Counterfactual eXplanations
|
|
5
5
|
Author-email: Szymon Bobek <szymon.bobek@gmail.com>, Piotr Kubacki <piotr.kubacki00@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -9,6 +9,8 @@ Project-URL: Documentation, https://acfx.readthedocs.org
|
|
|
9
9
|
Project-URL: Issues, https://github.com/sbobek/acfx/issues
|
|
10
10
|
Keywords: xai,tabular data,explainability,model-agnostic,counterfactual,causal
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
14
|
Classifier: Operating System :: OS Independent
|
|
13
15
|
Requires-Python: >=3.10
|
|
14
16
|
Description-Content-Type: text/markdown
|
|
@@ -16,9 +18,9 @@ License-File: LICENSE
|
|
|
16
18
|
Requires-Dist: numpy==1.26.0; python_version < "3.12"
|
|
17
19
|
Requires-Dist: numpy<=2.4.3,>=1.26.0; python_version >= "3.12"
|
|
18
20
|
Requires-Dist: pandas==1.5.3; python_version < "3.12"
|
|
19
|
-
Requires-Dist: pandas<=2.3
|
|
21
|
+
Requires-Dist: pandas<=2.4.3,>=1.5.3; python_version >= "3.12"
|
|
20
22
|
Requires-Dist: scipy==1.11.4; python_version < "3.12"
|
|
21
|
-
Requires-Dist: scipy<1.17,>=1.11.
|
|
23
|
+
Requires-Dist: scipy<1.17,>=1.11.4; python_version >= "3.12"
|
|
22
24
|
Requires-Dist: scikit-learn==1.6.1; python_version < "3.12"
|
|
23
25
|
Requires-Dist: scikit-learn<=1.8.0,>=1.6.1; python_version >= "3.12"
|
|
24
26
|
Requires-Dist: optuna==4.2.0
|
|
@@ -27,17 +29,17 @@ Requires-Dist: interpret==0.7.3
|
|
|
27
29
|
Requires-Dist: interpret-core==0.7.3
|
|
28
30
|
Requires-Dist: overrides==7.4.0
|
|
29
31
|
Provides-Extra: benchmark
|
|
30
|
-
Requires-Dist: tensorflow==2.14.0; python_version
|
|
31
|
-
Requires-Dist: lingam==1.9.1; python_version
|
|
32
|
-
Requires-Dist: openml==0.15.1; python_version
|
|
33
|
-
Requires-Dist: alibi==0.9.6; python_version
|
|
34
|
-
Requires-Dist: lux-explainer==1.3.2; python_version
|
|
35
|
-
Requires-Dist: networkx==3.4.2; python_version
|
|
36
|
-
Requires-Dist: cfnow==0.0.6; python_version
|
|
37
|
-
Requires-Dist: dice-ml==0.11; python_version
|
|
38
|
-
Requires-Dist: pydotplus==2.0.2; python_version
|
|
39
|
-
Requires-Dist: deap==1.4.2; python_version
|
|
40
|
-
Requires-Dist: pydot==3.0.4; python_version
|
|
32
|
+
Requires-Dist: tensorflow==2.14.0; python_version <= "3.11" and extra == "benchmark"
|
|
33
|
+
Requires-Dist: lingam==1.9.1; python_version <= "3.11" and extra == "benchmark"
|
|
34
|
+
Requires-Dist: openml==0.15.1; python_version <= "3.11" and extra == "benchmark"
|
|
35
|
+
Requires-Dist: alibi==0.9.6; python_version <= "3.11" and extra == "benchmark"
|
|
36
|
+
Requires-Dist: lux-explainer==1.3.2; python_version <= "3.11" and extra == "benchmark"
|
|
37
|
+
Requires-Dist: networkx==3.4.2; python_version <= "3.11" and extra == "benchmark"
|
|
38
|
+
Requires-Dist: cfnow==0.0.6; python_version <= "3.11" and extra == "benchmark"
|
|
39
|
+
Requires-Dist: dice-ml==0.11; python_version <= "3.11" and extra == "benchmark"
|
|
40
|
+
Requires-Dist: pydotplus==2.0.2; python_version <= "3.11" and extra == "benchmark"
|
|
41
|
+
Requires-Dist: deap==1.4.2; python_version <= "3.11" and extra == "benchmark"
|
|
42
|
+
Requires-Dist: pydot==3.0.4; python_version <= "3.11" and extra == "benchmark"
|
|
41
43
|
Provides-Extra: streamlit-app
|
|
42
44
|
Requires-Dist: streamlit==1.48.0; extra == "streamlit-app"
|
|
43
45
|
Requires-Dist: streamlit-sortables==0.3.1; extra == "streamlit-app"
|
|
@@ -12,13 +12,13 @@ scikit-learn==1.6.1
|
|
|
12
12
|
|
|
13
13
|
[:python_version >= "3.12"]
|
|
14
14
|
numpy<=2.4.3,>=1.26.0
|
|
15
|
-
pandas<=2.3
|
|
16
|
-
scipy<1.17,>=1.11.
|
|
15
|
+
pandas<=2.4.3,>=1.5.3
|
|
16
|
+
scipy<1.17,>=1.11.4
|
|
17
17
|
scikit-learn<=1.8.0,>=1.6.1
|
|
18
18
|
|
|
19
19
|
[benchmark]
|
|
20
20
|
|
|
21
|
-
[benchmark:python_version
|
|
21
|
+
[benchmark:python_version <= "3.11"]
|
|
22
22
|
tensorflow==2.14.0
|
|
23
23
|
lingam==1.9.1
|
|
24
24
|
openml==0.15.1
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "acfx"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.7dev"
|
|
8
8
|
description = "Actionable Counterfactual eXplanations"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [
|
|
@@ -15,48 +15,46 @@ license = { text = "MIT" }
|
|
|
15
15
|
keywords = ["xai", "tabular data","explainability", "model-agnostic", "counterfactual", "causal"]
|
|
16
16
|
|
|
17
17
|
dependencies = [
|
|
18
|
-
"numpy==1.26.0; python_version <
|
|
19
|
-
"numpy>=1.26.0,<=2.4.3; python_version >=
|
|
20
|
-
|
|
21
|
-
"pandas
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
"scikit-learn==1.6.1; python_version < \"3.12\"",
|
|
28
|
-
"scikit-learn>=1.6.1,<=1.8.0; python_version >= \"3.12\"",
|
|
18
|
+
"numpy==1.26.0; python_version < '3.12'",
|
|
19
|
+
"numpy>=1.26.0,<=2.4.3; python_version >= '3.12'",
|
|
20
|
+
"pandas==1.5.3; python_version < '3.12'",
|
|
21
|
+
"pandas>=1.5.3,<=2.4.3; python_version >= '3.12'",
|
|
22
|
+
"scipy==1.11.4; python_version < '3.12'",
|
|
23
|
+
"scipy>=1.11.4,<1.17; python_version >= '3.12'",
|
|
24
|
+
"scikit-learn==1.6.1; python_version < '3.12'",
|
|
25
|
+
"scikit-learn>=1.6.1,<=1.8.0; python_version >= '3.12'",
|
|
29
26
|
|
|
30
27
|
"optuna==4.2.0",
|
|
31
28
|
"pgmpy==1.0.0",
|
|
32
29
|
"interpret==0.7.3",
|
|
33
30
|
"interpret-core==0.7.3",
|
|
34
31
|
"overrides==7.4.0"
|
|
35
|
-
|
|
36
32
|
]
|
|
37
33
|
|
|
38
34
|
requires-python = ">=3.10"
|
|
39
35
|
|
|
40
36
|
classifiers = [
|
|
41
37
|
"Programming Language :: Python :: 3",
|
|
38
|
+
"Programming Language :: Python :: 3.11",
|
|
39
|
+
"Programming Language :: Python :: 3.12",
|
|
42
40
|
"Operating System :: OS Independent"
|
|
43
41
|
]
|
|
44
42
|
|
|
45
43
|
|
|
46
44
|
[project.optional-dependencies]
|
|
47
45
|
benchmark = [
|
|
48
|
-
"tensorflow==2.14.0; python_version
|
|
49
|
-
"lingam==1.9.1; python_version
|
|
50
|
-
"openml==0.15.1; python_version
|
|
51
|
-
"alibi==0.9.6; python_version
|
|
52
|
-
"lux-explainer==1.3.2; python_version
|
|
53
|
-
"networkx==3.4.2; python_version
|
|
54
|
-
"cfnow==0.0.6; python_version
|
|
55
|
-
"dice-ml==0.11; python_version
|
|
56
|
-
"pydotplus==2.0.2; python_version
|
|
57
|
-
"deap==1.4.2; python_version
|
|
58
|
-
"pydot==3.0.4; python_version
|
|
59
|
-
|
|
46
|
+
"tensorflow==2.14.0; python_version <= '3.11'",
|
|
47
|
+
"lingam==1.9.1; python_version <= '3.11'",
|
|
48
|
+
"openml==0.15.1; python_version <= '3.11'",
|
|
49
|
+
"alibi==0.9.6; python_version <= '3.11'",
|
|
50
|
+
"lux-explainer==1.3.2; python_version <= '3.11'",
|
|
51
|
+
"networkx==3.4.2; python_version <= '3.11'",
|
|
52
|
+
"cfnow==0.0.6; python_version <= '3.11'",
|
|
53
|
+
"dice-ml==0.11; python_version <= '3.11'",
|
|
54
|
+
"pydotplus==2.0.2; python_version <= '3.11'",
|
|
55
|
+
"deap==1.4.2; python_version <= '3.11'",
|
|
56
|
+
"pydot==3.0.4; python_version <= '3.11'"
|
|
57
|
+
]
|
|
60
58
|
streamlit-app = ["streamlit==1.48.0", "streamlit-sortables==0.3.1", "networkx==3.4.2", "lingam==1.9.1"]
|
|
61
59
|
|
|
62
60
|
[tool.setuptools.packages.find]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|