Silent deployment of AIM2REDUCE models to predict undesirable cancer events in Princess Margaret hospital under the EPIC system.
git clone https://github.com/ml4oncology/model-deployer
pip install -e ".[dev]"
playwright install chromium
# optional
pre-commit install
mypy --install-typespython src/main.py --start-date 20240904 --end-date 20250804 --model-anchor clinic
python src/monthly_model_eval.py --model-anchor clinic --monthly-pull-date 20250604 --start-date 20240904 --end-date 20250804 --disable-save-dashboard-pngDashboard prerequisite:
- Dashboard generation uses the silent deployment baseline file. To create that baseline, first run
python src/main.py --start-date [start_date] --end-date [end_date] --model-anchor clinic --run-on-silent-deployment True, where[start_date]and[end_date]are the silent deployment dates. - If you are not generating that silent deployment baseline first, run
src/main.pywith--disable-save-dashboard-pngto avoid dashboard generation errors.
Optional dashboard arguments:
--dashboard-layout {portrait,landscape}controls the dashboard image layout. Default isportrait.--dashboard-font-scale FLOATscales clinician-facing dashboard text and histogram text proportionally. Default is1.0.--disable-save-dashboard-pngskips dashboard PNG generation. By default, dashboard PNGs are generated.--subset-dashboard-patientslimits dashboard generation to the selected patient subset. Default isTrue.--no-subset-dashboard-patientsdisables subset filtering and generates dashboards for all patients.--run-on-silent-deploymentruns the code on silent deployment patients for baseline histogram in dashboard. Default isFalse.
Example:
python src/main.py --start-date 20240904 --end-date 20250804 --model-anchor clinic --dashboard-font-scale 1.5
python src/main.py --start-date 20240904 --end-date 20250804 --model-anchor clinic --no-subset-dashboard-patients├── src <- The source code
├── Data <- The daily, weekly, and monthly data pulls
├── Models <- ML models
└── Infos <- Configuration files (regimen mapping, thresholds, etc)
└── Prep
AIM2REDUCE_DATA_YYYYMMDD.csv
- patients and their historical records who had a treatment scheduled the following day of
- pulled daily
AIM2REDUCE_DATA_monthly_YYYYMMDD.csv
- patients and their historical records who had a treatment since March 2024 until the month before the date
- pulled monthly
AIM2REDUCE_DATA_weekly_YYYYMMDD.csv
- patients and their historical records who had a clinic visit on the day of and have treatment scheduled within the next 5 days
- pulled daily
AIM2REDUCE_DATA_weekly_monthly_YYYYMMDD.csv
- patients and their historical records who had a clinic visit since Sep 2024 until the month before the date
- pulled monthly