WarfaRisk baselines (IWPC-6256)

This repository holds the three Phase 1 baselines from the pipeline described in Beyond Mean Absolute Error: Ancestry-Stratified Calibration and Explainability for Warfarin Dosing Models. They set the performance floor for every later model in the project: no model is reported as an improvement unless it beats the IWPC published equation below (MAE 9.177).

Authors: Hassan Barmandah, Omar Abdullah Bawazir, Siraj Aldeen Marghalani, Moath Shaat, Abdullah N. Alkattan and Mariam M. AlEissa (corresponding author), Alfaisal University, Riyadh (with Umm Al-Qura University, Saudi Electronic University, Ministry of Health, Public Health Authority, King Khaled Eye Specialist Hospital Research Center and King Abdullah Petroleum Studies and Research Center).

Code HuggingFace License

This is a research artifact, not a validated clinical tool. It has not been evaluated prospectively and has no regulatory status.

Overview

Three baselines were evaluated on IWPC-6256 (n=6,037 after cleaning, n_test=1,207, fixed 80/20 patient-level split, seed 20260725):

  1. Naive median-dose predictor. It always outputs the median dose of the training fold.
  2. Clinical-only linear regression. Ordinary least squares on clinical features only (age, weight, height, indication, comorbidity and comedication flags), with no genetic information.
  3. IWPC published pharmacogenetic equation. A hand-implemented version of the published square-root-of-dose formula (IWPC, N Engl J Med 2009;360:753-64). It is the only one of the three that uses genotype (CYP2C9 and VKORC1).

The equation's coefficients were transcribed from the widely cited public form, the same form used by calculators such as warfarindosing.org. They were not checked directly against Table 2 of the original paper.

How to use

import joblib  # only load .joblib files from this trusted repository
from huggingface_hub import hf_hub_download

model_path = hf_hub_download(
    repo_id="HassanB4/warfarisk-baselines",
    filename="clinical_only_linear_regression.joblib",
)
model = joblib.load(model_path)
prediction = model.predict(your_clinical_features_dataframe)

The IWPC equation is a plain Python function, iwpc_published_equation_predict(), not a fitted estimator. Its implementation is in src/warfarisk/phase1_baselines.py.

Training

Split Samples Description
Training 4,830 80% of IWPC-6256, split by patient ID
Test 1,207 Held out, seed 20260725
Setting Value
Cohort IWPC-6256
Split level Patient ID, not row
Split seed 20260725
Test fraction 0.20
Leakage audit 11 of 11 checks passed
Preprocessing fit Training fold only

Results

Baseline MAE (mg/week) R² PW20
Naive median dose 12.339 -0.048 0.342
Clinical-only linear regression 10.860 0.222 0.354
IWPC published pharmacogenetic equation 9.177 0.413 0.429

PW20 is the share of predictions within 20% of the true dose. IWPC's clinical-acceptability threshold is 0.50, and none of the three baselines reaches it. See warfarisk-autogluon-6256 for a model that gets closer.

Limitations

  • Research use only: not validated prospectively and no regulatory status.
  • The equation's coefficients were not verified against the original paper's Table 2.
  • Evaluated on IWPC-6256 only. See warfarisk-autogluon-1780 for the second cohort.
  • IWPC-6256 splits Black and African American patients across three overlapping labels, which affects subgroup-level interpretation of any model trained on this cohort. The project's Phase 4 and 5 analyses address this.

License and data

Apache-2.0. The model was fit on IWPC data. The fitted artifact and code are shared under Apache-2.0, but the IWPC dataset is not redistributed. See data/DATA.md for how to obtain it.

Acknowledgements

We thank PharmGKB and the International Warfarin Pharmacogenetics Consortium for the IWPC dataset.

Links: PharmGKB, code repository.

Citation

The models and pipeline are described in the following article, published in the Journal of Personalized Medicine.

Barmandah, H.; Bawazir, O.A.; Marghalani, S.A.; Shaat, M.; Alkattan, A.N.; AlEissa, M.M. Beyond Mean Absolute Error: Ancestry-Stratified Calibration and Explainability for Warfarin Dosing Models. J. Pers. Med. 2026, 16 (10), 531. https://doi.org/10.3390/jpm16100531

@Article{jpm16100531,
    author={Barmandah, Hassan and Bawazir, Omar A. and Marghalani, Siraj Aldeen and Shaat, Muath and Alkattan, Abdullah N. and AlEissa, Mariam M.},
    title={Beyond Mean Absolute Error: Ancestry-Stratified Calibration and Explainability for Warfarin Dosing Models},
    journal={Journal of Personalized Medicine},
    volume={16},
    year={2026},
    number={10},
    article-number={531},
    url={https://www.mdpi.com/2075-4426/16/10/531},
    issn={2075-4426},
    doi={10.3390/jpm16100531}
}

The prototype system that uses these models (pipeline, web interface and explanation layer) is described in a companion paper in MDPI AI.

Barmandah, H.; Marghalani, S.A.; Bawazir, O.A.; Shaat, M.; Alkattan, A.N.; AlEissa, M.M. WarfaRisk: A Reproducible, Fairness-Aware Machine Learning Pipeline for Warfarin Dose Prediction (Prototype). AI 2026, 7 (10), 431. https://doi.org/10.3390/ai7100431

@article{barmandah2026warfarisk,
  author  = {Barmandah, Hassan and Marghalani, Siraj Aldeen and Bawazir, Omar Abdullah and Shaat, Muath and Alkattan, Abdullah N. and AlEissa, Mariam M.},
  title   = {{WarfaRisk}: A Reproducible, Fairness-Aware Machine Learning Pipeline for Warfarin Dose Prediction (Prototype)},
  journal = {AI},
  publisher = {MDPI},
  volume  = {7},
  number  = {10},
  pages   = {431},
  year    = {2026},
  doi     = {10.3390/ai7100431},
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Collection including HassanB4/warfarisk-baselines

Evaluation results

  • MAE (IWPC published equation) on IWPC-6256 (International Warfarin Pharmacogenetics Consortium)
    self-reported
    9.177
  • R2 (IWPC published equation) on IWPC-6256 (International Warfarin Pharmacogenetics Consortium)
    self-reported
    0.413