Skip to content

Conversation

@jhnwu3
Copy link
Collaborator

@jhnwu3 jhnwu3 commented Jan 9, 2026

This pull request introduces several documentation improvements and adds a new benchmarking script for length of stay prediction using pandas. The most significant changes are the addition of interpretability documentation for Vision Transformers (ViT), new visualization utility documentation, expanded tutorial listings for image analysis, and a comprehensive benchmark script for MIMIC-IV data.

Documentation Enhancements for Interpretability and Vision Transformers (ViT):

  • Added a new example for Chefer's attention-based attribution for Vision Transformers to the interpretability documentation, including training and visualization steps for COVID-19 chest X-ray classification (docs/api/interpret.rst).
  • Documented new visualizati
    This pull request introduces significant improvements to the documentation and benchmarking utilities for interpretability and image analysis in PyHealth, as well as adds a new benchmarking script for length-of-stay prediction using pandas. The main changes include expanded interpretability documentation (especially for Vision Transformers), a detailed API reference for visualization utilities, improved organization of image analysis tutorials, and the addition of a comprehensive benchmarking script for MIMIC-IV data processing.

Documentation Improvements

  • Expanded interpretability documentation in docs/api/interpret.rst to include a new ViT/Chefer attribution example, providing step-by-step guidance on using CheferRelevance for Vision Transformers and visualizing model attributions.
  • Added a new section for visualization utilities in docs/api/interpret.rst, introducing the pyhealth.interpret.utils module and its specialized support for Vision Transformer attribution visualizations.
  • Created a dedicated API reference file docs/api/interpret/pyhealth.interpret.utils.rst that details all visualization functions, normalization utilities, and ViT-specific visualization helpers, including example usage for both standard and ViT attributions.

Tutorial and Example Organization

  • Updated the image analysis section in docs/tutorials.rst to clarify that chest X-ray examples are located in the examples/cxr/ directory, and reorganized the list of example files for better clarity and coverage of new notebooks and scripts.

Benchmarking Utilities

  • Added a new script examples/benchmark_perf/benchmark_pandas_los.py that benchmarks length-of-stay prediction processing using pandas on MIMIC-IV data, mirroring the PyHealth LengthOfStayPredictionMIMIC4 task. The script includes patient-level processing, LOS categorization, memory and time tracking, and outputs detailed statistics and results.on utilities for attribution overlays and ViT-specific visualizations, with links to relevant utility functions (docs/api/interpret.rst, docs/api/interpret/pyhealth.interpret.utils.rst). [1] [2]

Expanded Tutorials and Example Listings:

  • Updated the image analysis tutorial table to include ViT training and interpretability, binary and multilabel classification notebooks, and saliency map examples for chest X-ray datasets (docs/tutorials.rst).

New Benchmark Script for Length of Stay Prediction:

  • Added examples/benchmark_perf/benchmark_pandas_los.py, a standalone script that benchmarks visit-level length of stay prediction on MIMIC-IV data using pandas. The script processes admissions, diagnoses, procedures, and prescriptions, categorizes LOS, tracks memory usage, and outputs summary statistics and results.

@jhnwu3 jhnwu3 added the component: interpret Contribute a new interpretability method to PyHealth label Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: interpret Contribute a new interpretability method to PyHealth

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants