Skip to content

feat(tracking): add optional experiment manifests - #1619

Draft
dalloliogm wants to merge 1 commit into
sunlabuiuc:masterfrom
dalloliogm:codex/optional-experiment-tracking
Draft

dalloliogm wants to merge 1 commit into
sunlabuiuc:masterfrom
dalloliogm:codex/optional-experiment-tracking

Conversation

@dalloliogm

Copy link
Copy Markdown
Contributor

Contributor: Giovanni Dall'Olio

Contribution type: Optional utility

PyHealth users running custom experiments can record selected parameters, aggregate metrics and optional prompt-template provenance without requiring an external service. This PR adds an independent record_experiment utility with local JSON manifests and an optional MLflow backend. It was separated from the GiantMed bounty implementation in #1502 so that the general-purpose tracking API can be reviewed on its own.

The utility is opt-in and does not alter Trainer or automatically collect per-epoch metrics, models, datasets, prompts or patient records. MLflow requires a separately installed package and an explicit tracking URI. Local fallback must be explicitly configured; the returned metadata identifies the actual backend and any partial MLflow run. Callers must provide patient-independent values: the utility does not redact supplied metadata.

Validation:

  • Eight tests and doctests passed, including local manifests, mock MLflow success and failures, explicit fallback, input validation and patient-independent metadata.
  • PR contribution rules passed locally.

Limitations: This is a single end-of-run manifest, not a Trainer integration or full experiment lifecycle. It does not capture checkpoints, interrupted runs, epoch metrics or provider routing. Prompt text and hash are caller-supplied provenance, not a reproducibility guarantee.

@github-actions

Copy link
Copy Markdown

Test Coverage

Total: 86.57% (47268 / 54604 lines)

Modified file Coverage Lines
pyhealth/experiment_tracking.py 85.14% 63 / 74

Workflow run · d8f13ab

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant