OnCardia predicts Cancer Therapy-Related Cardiac Dysfunction (CTRCD) in HER2+ breast-cancer patients. It pairs a guideline baseline (HFA-ICOS proforma) with gradient-boosted machine-learning tiers that add engineered clinical features and Tissue-Doppler-Imaging (TDI) markers.
| Tier | Inputs | Cohort |
|---|---|---|
| HFA-ICOS baseline | Guideline proforma over clinical risk factors | All 531 |
| Standard | 12 gain-screened engineered clinical features (XGBoost) | All 531 |
| Pro | Standard top-10 clinical + 2 TDI scalars (E-prime, E/A) | 270 TDI patients |
src/
features/clinical.py load_and_clean(), engineer_features() (8-step pipeline)
features/tdi.py extract_tdi_features() (E-prime / A-prime / E-A from TDI curves)
models/hfa_icos.py HFA-ICOS scorer (score_patient, score_hfa_icos_dataframe)
models/standard_tier.py StandardTierModel (gain screen + XGBoost)
models/pro_tier.py ProTierModel (clinical + TDI scalars)
evaluation/bootstrap.py bootstrap_auc_ci()
evaluation/nri.py categorical_nri(), bootstrap_nri_ci() (Pencina 2008)
evaluation/dca.py decision_curve_analysis()
evaluation/calibration.py calibration_data(), Brier score
tests/ unit tests (HFA-ICOS, features, evaluation)
notebooks/ 01_eda ... 06_evaluation (end-to-end analysis)
artifacts/ models/ and figures/ outputs
data/ raw CSVs (gitignored — see data/README.md)
conda activate oncardia-model # or your environment of choice
pip install -r requirements.txtPlace the raw BC_cardiotox_*.csv files in data/ (see data/README.md — they
are semicolon-separated with a decimal comma and are not committed).
Tests:
python -m pytest tests/ -vNotebooks (run in order):
jupyter lab notebooks/ # or: jupyter nbconvert --execute --inplace notebooks/*.ipynbnotebooks/_build_notebooks.py regenerates all six notebooks from source if
needed.
- Canonical split: 70:30 stratified on CTRCD,
RANDOM_SEED=42. The Pro tier uses a separate 70:30 split over the 270 TDI patients. - Feature selection: XGBoost gain screen on the training split selects the
top features; the Standard tier uses 12, the Pro tier the Standard top-10 plus
tdi_e_primeandtdi_e_a_ratio. - Metrics: AUC (primary, with bootstrap 95% CI) and categorical NRI (secondary, Pencina 2008) with 3 risk buckets — Low (<10%), Moderate (10-19%), High (>=20%). Decision-curve and calibration analyses round out the suite.
- TDI markers: E-prime and A-prime are extracted from the diastolic half of
the velocity curve via
scipy.signal.find_peaks; AF (heart_rhythm=1), flat, and single-peak curves yield NaN and are imputed before modelling.
All randomness (split, XGBoost, bootstrap) is seeded with RANDOM_SEED = 42.