Add/cxr comprehensive tutorial and benchmarks for PyHealth paper #773
+7,735
−416
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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):
docs/api/interpret.rst).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
docs/api/interpret.rstto include a new ViT/Chefer attribution example, providing step-by-step guidance on using CheferRelevance for Vision Transformers and visualizing model attributions.docs/api/interpret.rst, introducing thepyhealth.interpret.utilsmodule and its specialized support for Vision Transformer attribution visualizations.docs/api/interpret/pyhealth.interpret.utils.rstthat details all visualization functions, normalization utilities, and ViT-specific visualization helpers, including example usage for both standard and ViT attributions.Tutorial and Example Organization
docs/tutorials.rstto clarify that chest X-ray examples are located in theexamples/cxr/directory, and reorganized the list of example files for better clarity and coverage of new notebooks and scripts.Benchmarking Utilities
examples/benchmark_perf/benchmark_pandas_los.pythat 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:
docs/tutorials.rst).New Benchmark Script for Length of Stay Prediction:
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.