Announcing the mccv python package with Quarto website

Monte Carlo Cross Validation (MCCV) is a peer-reviewed clinical machine learning algorithm that is now implemented in a package and showcased in a website built by Quarto


June 18, 2023

One of the research questions during my PhD was can we generate evidence before a heart transplant for proteins in blood to predict heart failure within 24 hours after the transplant? Ideally, the clinical team wanted an equation that would provide a probability of heart failure for a patient. Another requirement for this equation was that it would generalize to patients across heart clinics, such as in the US or Europe, and outperform existing clinical scores. This question was what motivated developing the algorithm Monte Carlo Cross Validation (MCCV)*.

*The algorithm is not new, but in late 2016 I wasn’t familiar with an open source implementation for the question and I wanted to use this as an opportunity to learn python.

Fast forward 5 years, 2 papers were published where we used MCCV and found pre-transplant predictive evidence for plasma kallikrein (KLKB1) towards post-transplant heart failure1,2. The algorithm MCCV was written as a few python functions in scripts for both papers3,4. At the time of publishing the papers, I knew I would eventually incorporate the functions into a package to make the algorithm more widely available*. That time came after publishing the papers and after I defended my PhD thesis. Serendipitously, the software Quarto, which was announced by Posit, allowed making a website AND interchangeably write python and R code in the same document. Quarto allowed showcasing the algorithm in both programming languages (with prettier visualizations from R) along with tutorials and detailed explanations.

*Also I wrote the python package for the opportunity to code in python since I mostly code in R for work.

The mccv python package is available on GitHub and is also shown on a website* written in Quarto. The website includes several tutorials in the navigation bar at the top of the page.

Thank you for reading this post! Reply in the comments if you find the algorithm useful in your own work. I also want to give a shoutout to the Quarto team for developing a great communication tool. I highly recommend having an accompanying website for analytical software packages (luckily, this is easier for developing R packages with the {pkgdown} package])!


Giangreco NP, Lebreton G, Restaino S, Jane Farr M, Zorn E, Colombo PC, Patel J, Levine R, Truby L, Soni RK, Leprince P, Kobashigawa J, Tatonetti NP, Fine BM. Plasma kallikrein predicts primary graft dysfunction after heart transplant. J. Heart Lung Transplant. 2021;40(10):1199–1211.
Giangreco NP, Lebreton G, Restaino S, Farr M, Zorn E, Colombo PC, Patel J, Soni RK, Leprince P, Kobashigawa J, Tatonetti NP, Fine BM. Alterations in the kallikrein-kinin system predict death after heart transplant. Sci. Rep. 2022;12(1):14167.