acfx 0.3.7.dev0__tar.gz → 0.3.7.dev1__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.7.dev0 → acfx-0.3.7.dev1}/PKG-INFO +1 -1
- {acfx-0.3.7.dev0 → acfx-0.3.7.dev1}/acfx/evaluation/ccfs.py +8 -3
- {acfx-0.3.7.dev0 → acfx-0.3.7.dev1}/acfx.egg-info/PKG-INFO +1 -1
- {acfx-0.3.7.dev0 → acfx-0.3.7.dev1}/pyproject.toml +1 -1
- {acfx-0.3.7.dev0 → acfx-0.3.7.dev1}/LICENSE +0 -0
- {acfx-0.3.7.dev0 → acfx-0.3.7.dev1}/acfx/ACFX.py +0 -0
- {acfx-0.3.7.dev0 → acfx-0.3.7.dev1}/acfx/AcfxCustom.py +0 -0
- {acfx-0.3.7.dev0 → acfx-0.3.7.dev1}/acfx/AcfxEBM.py +0 -0
- {acfx-0.3.7.dev0 → acfx-0.3.7.dev1}/acfx/AcfxLinear.py +0 -0
- {acfx-0.3.7.dev0 → acfx-0.3.7.dev1}/acfx/RandomSearchCounterOptimizer.py +0 -0
- {acfx-0.3.7.dev0 → acfx-0.3.7.dev1}/acfx/__init__.py +0 -0
- {acfx-0.3.7.dev0 → acfx-0.3.7.dev1}/acfx/abstract/ModelBasedCounterOptimizer.py +0 -0
- {acfx-0.3.7.dev0 → acfx-0.3.7.dev1}/acfx/abstract/OptimizerType.py +0 -0
- {acfx-0.3.7.dev0 → acfx-0.3.7.dev1}/acfx/abstract/__init__.py +0 -0
- {acfx-0.3.7.dev0 → acfx-0.3.7.dev1}/acfx/evaluation/EBMCounterOptimizer.py +0 -0
- {acfx-0.3.7.dev0 → acfx-0.3.7.dev1}/acfx/evaluation/LogisticRegressionCounterOptimizer.py +0 -0
- {acfx-0.3.7.dev0 → acfx-0.3.7.dev1}/acfx/evaluation/__init__.py +0 -0
- {acfx-0.3.7.dev0 → acfx-0.3.7.dev1}/acfx/evaluation/bayesian_model.py +0 -0
- {acfx-0.3.7.dev0 → acfx-0.3.7.dev1}/acfx/evaluation/loss.py +0 -0
- {acfx-0.3.7.dev0 → acfx-0.3.7.dev1}/acfx/evaluation/multi_dataset_evaluation.py +0 -0
- {acfx-0.3.7.dev0 → acfx-0.3.7.dev1}/acfx/evaluation/utils.py +0 -0
- {acfx-0.3.7.dev0 → acfx-0.3.7.dev1}/acfx.egg-info/SOURCES.txt +0 -0
- {acfx-0.3.7.dev0 → acfx-0.3.7.dev1}/acfx.egg-info/dependency_links.txt +0 -0
- {acfx-0.3.7.dev0 → acfx-0.3.7.dev1}/acfx.egg-info/requires.txt +0 -0
- {acfx-0.3.7.dev0 → acfx-0.3.7.dev1}/acfx.egg-info/top_level.txt +0 -0
- {acfx-0.3.7.dev0 → acfx-0.3.7.dev1}/setup.cfg +0 -0
|
@@ -89,7 +89,12 @@ def __generate_single_cf(query_instance, desired_class, adjacency_matrix, causal
|
|
|
89
89
|
# Define seen_points set to track uniqueness of points
|
|
90
90
|
seen_points = set()
|
|
91
91
|
|
|
92
|
-
def is_unique_point(point_dict):
|
|
92
|
+
def is_unique_point(point_dict, pbounds):
|
|
93
|
+
for key, (min_val, max_val) in pbounds.items():
|
|
94
|
+
val = point_dict.get(key)
|
|
95
|
+
if val is None or not (min_val <= val <= max_val):
|
|
96
|
+
return False
|
|
97
|
+
|
|
93
98
|
point_tuple = tuple(point_dict[key] for key in features_order)
|
|
94
99
|
if point_tuple in seen_points:
|
|
95
100
|
return False
|
|
@@ -107,7 +112,7 @@ def __generate_single_cf(query_instance, desired_class, adjacency_matrix, causal
|
|
|
107
112
|
Xsample = Xdesired.sample(sample_size)
|
|
108
113
|
for i, r in Xsample.iterrows():
|
|
109
114
|
candidate_point = dict(r[features_order])
|
|
110
|
-
if is_unique_point(candidate_point):
|
|
115
|
+
if is_unique_point(candidate_point, bounds):
|
|
111
116
|
trial_params = {key: candidate_point[key] for key in features_order}
|
|
112
117
|
study.enqueue_trial(trial_params)
|
|
113
118
|
sampled_trials += 1
|
|
@@ -152,7 +157,7 @@ def __generate_single_cf(query_instance, desired_class, adjacency_matrix, causal
|
|
|
152
157
|
else:
|
|
153
158
|
raise ValueError("Unexpected format for cf")
|
|
154
159
|
|
|
155
|
-
if is_unique_point(cf_dict):
|
|
160
|
+
if is_unique_point(cf_dict, bounds):
|
|
156
161
|
sampled_trials += 1
|
|
157
162
|
study.enqueue_trial(cf_dict)
|
|
158
163
|
return sampled_trials
|
|
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
|
|
File without changes
|