Skip to content

Commit

Permalink
precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
JHoelli committed Aug 23, 2023
1 parent a883de3 commit 5ae0f8e
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,18 +147,17 @@ def _native_guide_retrieval(self, query, predicted_label, distance, n_neighbors)
x_train.reshape(-1, 1, ts_length)
return dist[0], x_train[np.where(y != predicted_label)][ind[0]]


def _native_guide_wrapper(self, query, predicted_label, distance, n_neighbors):
_, nun = self._native_guide_retrieval(
query, predicted_label, distance, n_neighbors
)
if nun is None:
if nun is None:
return None, None
individual = np.array(nun.tolist()) # , dtype=np.float64)
out = self.predict(individual)
if np.argmax(out) == predicted_label:
print("No Counterfactual found. Most likly caused by a constant predictor.")
return None, None
print("No Counterfactual found. Most likly caused by a constant predictor.")
return None, None

return nun, np.argmax(out)

Expand Down

0 comments on commit 5ae0f8e

Please sign in to comment.