Skip to content

whelena/oncardia-model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OnCardia — Cardiotoxicity Risk Model

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.

Tiers

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

Repository layout

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)

Setup

conda activate oncardia-model        # or your environment of choice
pip install -r requirements.txt

Place the raw BC_cardiotox_*.csv files in data/ (see data/README.md — they are semicolon-separated with a decimal comma and are not committed).

Running

Tests:

python -m pytest tests/ -v

Notebooks (run in order):

jupyter lab notebooks/        # or: jupyter nbconvert --execute --inplace notebooks/*.ipynb

notebooks/_build_notebooks.py regenerates all six notebooks from source if needed.

Key design decisions

  • 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_prime and tdi_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.

Reproducibility

All randomness (split, XGBoost, bootstrap) is seeded with RANDOM_SEED = 42.

About

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.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages