Add missing citations in PyHealth code#1181
Merged
Merged
Conversation
…, comprehensiveness/sufficiency metrics, MLE, and NNAAR
Contributor
There was a problem hiding this comment.
Pull request overview
Adds literature/code citations and usage examples across several PyHealth models and evaluation metrics to improve traceability and provide better debugging/reference context in the generated docs.
Changes:
- Added paper/code citations to
TFMTokenizer,EHRMambaCEHR, and CEHR embedding docstrings. - Added citations for interpretability (ERASER) and generative metrics (TSTR/MLE and NNAAR).
- Updated Sphinx API docs and an example script header to point readers to the new references.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pyhealth/models/tfm_tokenizer.py | Adds TFM-Tokenizer paper + code citation in the model docstring. |
| pyhealth/models/ehrmamba_cehr.py | Adds EHRMAMBA paper citation and an end-to-end usage example to the class docstring. |
| pyhealth/models/cehr_embeddings.py | Adds EHRMAMBA/Odyssey embedding citation and a small usage example. |
| pyhealth/metrics/interpretability/sufficiency.py | Adds ERASER paper citation to the sufficiency metric docstring. |
| pyhealth/metrics/interpretability/comprehensiveness.py | Adds ERASER paper citation to the comprehensiveness metric docstring. |
| pyhealth/metrics/generative/utility.py | Adds TSTR protocol citation to MLE utility metric docstring. |
| pyhealth/metrics/generative/privacy.py | Adds NNAAR paper citation to privacy metric docstring. |
| examples/conformal_eeg/test_tfm_tuev_inference.py | Adds a pointer to the TFMTokenizer citation for the inference example. |
| docs/api/metrics/pyhealth.metrics.generative.rst | Updates the generative metrics API docs intro to reference per-function docstrings. |
Comments suppressed due to low confidence (2)
pyhealth/models/tfm_tokenizer.py:731
- Line contains trailing whitespace in the class docstring (blank line with spaces). This can trigger linting failures (e.g., W291) and makes diffs noisier.
The model expects two inputs:
- STFT spectrogram: shape (batch, n_freq, n_time)
- Raw temporal signal: shape (batch, n_samples)
Args:
pyhealth/models/ehrmamba_cehr.py:32
- The docstring's Args section is incomplete: init accepts additional parameters (type_vocab_size, max_num_visits, time_embeddings_size, visit_segment_vocab) that are not documented here, which can mislead users reading the API docs.
Args:
dataset: Fitted :class:`~pyhealth.datasets.SampleDataset` with MPF task schema.
vocab_size: Concept embedding vocabulary size (typically ``task.vocab.vocab_size``).
embedding_dim: Hidden size (``hidden_size`` in CEHR embeddings).
num_layers: Number of :class:`~pyhealth.models.ehrmamba.MambaBlock` layers.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
4
to
+6
| Evaluation metrics for synthetic (generative) EHR data, covering privacy, | ||
| utility, and statistical fidelity. | ||
| utility, and statistical fidelity. See each function's docstring for the | ||
| paper it implements. |
jhnwu3
approved these changes
Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Added to TFMTokenizer, EHRMambaCEHR, CEHR embeddings, comprehensiveness/sufficiency metrics, MLE, and NNAAR. Good context for AI when debugging/needs a reference.