Skip to content

Commit

Permalink
small changes in indices selection
Browse files Browse the repository at this point in the history
  • Loading branch information
iwan-tee committed Apr 15, 2024
1 parent 73f74f6 commit 4ab46ad
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions docs/examples/plot_lcppn_explainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@
explanations = explainer.explain(X_test.values)
print(explanations)

# Filter samples which only predicted "Respiratory"
respiratory_idx = explainer.get_sample_indices(predictions, "Respiratory")

# Use .sel() method to apply the filter and obtain filtered results
shap_val_respiratory = explainer.filter_by_class(
explanations, class_name="Respiratory", sample_indices=respiratory_idx
explanations,
class_name="Respiratory",
sample_indices=explainer.get_sample_indices(predictions, "Respiratory"),
)


Expand Down

0 comments on commit 4ab46ad

Please sign in to comment.