Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/api/interpret.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ New to interpretability in PyHealth? Check out these complete examples:
- Compare different baseline strategies for background sample generation
- Decode attributions to human-readable medical codes and lab measurements

**LIME Example:**

- ``examples/lime_stagenet_mimic4.py`` - Demonstrates LIME (Local Interpretable Model-agnostic Explanations) for StageNet mortality prediction. Shows how to:

- Compute local linear approximations to explain model predictions
- Generate perturbations around input samples to train interpretable models
- Compare different regularization methods (Lasso vs Ridge) for feature selection
- Test various distance kernels (cosine vs euclidean) and sample sizes
- Decode attributions to human-readable medical codes and lab measurements

These examples provide end-to-end workflows from loading data to interpreting and evaluating attributions.

Available Methods
Expand All @@ -64,4 +74,5 @@ Available Methods
interpret/pyhealth.interpret.methods.deeplift
interpret/pyhealth.interpret.methods.integrated_gradients
interpret/pyhealth.interpret.methods.shap
interpret/pyhealth.interpret.methods.lime

19 changes: 19 additions & 0 deletions docs/api/interpret/pyhealth.interpret.methods.lime.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
pyhealth.interpret.methods.lime
===============================

Overview
--------

:class:`pyhealth.interpret.methods.lime.LimeExplainer` provides LIME (Local Interpretable Model-agnostic Explanations)
attributions for PyHealth models by approximating the model locally with an interpretable linear model. Consult the class docstring for
detailed guidance, usage notes, and examples. A full workflow is demonstrated in
``examples/lime_stagenet_mimic4.py``.

API Reference
-------------

.. autoclass:: pyhealth.interpret.methods.lime.LimeExplainer
:members:
:undoc-members:
:show-inheritance:
:member-order: bysource
Loading