proxyml 0.1.1__tar.gz → 0.1.2__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.
- {proxyml-0.1.1 → proxyml-0.1.2}/PKG-INFO +1 -1
- {proxyml-0.1.1 → proxyml-0.1.2}/pyproject.toml +1 -1
- {proxyml-0.1.1 → proxyml-0.1.2}/src/proxyml/client.py +2 -2
- {proxyml-0.1.1 → proxyml-0.1.2}/src/proxyml.egg-info/PKG-INFO +1 -1
- {proxyml-0.1.1 → proxyml-0.1.2}/LICENSE +0 -0
- {proxyml-0.1.1 → proxyml-0.1.2}/README.md +0 -0
- {proxyml-0.1.1 → proxyml-0.1.2}/setup.cfg +0 -0
- {proxyml-0.1.1 → proxyml-0.1.2}/src/proxyml/__init__.py +0 -0
- {proxyml-0.1.1 → proxyml-0.1.2}/src/proxyml/schema.py +0 -0
- {proxyml-0.1.1 → proxyml-0.1.2}/src/proxyml.egg-info/SOURCES.txt +0 -0
- {proxyml-0.1.1 → proxyml-0.1.2}/src/proxyml.egg-info/dependency_links.txt +0 -0
- {proxyml-0.1.1 → proxyml-0.1.2}/src/proxyml.egg-info/requires.txt +0 -0
- {proxyml-0.1.1 → proxyml-0.1.2}/src/proxyml.egg-info/top_level.txt +0 -0
- {proxyml-0.1.1 → proxyml-0.1.2}/tests/test_client.py +0 -0
- {proxyml-0.1.1 → proxyml-0.1.2}/tests/test_schema.py +0 -0
|
@@ -136,10 +136,10 @@ def predict(samples: list, version: int | None): # Defaults to latest version i
|
|
|
136
136
|
def find_counterfactual(sample, target, n_neighbors: int = 10000, perturbation_scale: float = 0.1, version: int | None = None, as_df: bool = True):
|
|
137
137
|
payload = {
|
|
138
138
|
'instance': sample,
|
|
139
|
-
'target_label': target,
|
|
139
|
+
'target_label': target.item() if hasattr(target, 'item') else target, # handle numpy scalars
|
|
140
140
|
'n_neighbors': n_neighbors,
|
|
141
141
|
'perturbation_scale': perturbation_scale,
|
|
142
|
-
}
|
|
142
|
+
}
|
|
143
143
|
if version: # Also rejects version 0 (versions start at 1)
|
|
144
144
|
payload['version'] = version
|
|
145
145
|
r = post(endpoint='/explain/counterfactual', payload=payload)
|
|
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
|