<!DOCTYPE article
PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD with MathML3 v1.3 20210610//EN" "JATS-archivearticle1-3-mathml3.dtd">
<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="1.3" xml:lang="en" article-type="research-article"><?properties open_access?><?properties manuscript?><processing-meta base-tagset="archiving" mathml-version="3.0" table-model="xhtml" tagset-family="jats"><restricted-by>pmc</restricted-by></processing-meta><front><journal-meta><journal-id journal-id-type="nlm-journal-id">101708638</journal-id><journal-id journal-id-type="pubmed-jr-id">46693</journal-id><journal-id journal-id-type="nlm-ta">J Open Source Softw</journal-id><journal-id journal-id-type="iso-abbrev">J Open Source Softw</journal-id><journal-title-group><journal-title>Journal of open source software</journal-title></journal-title-group><issn pub-type="epub">2475-9066</issn></journal-meta><article-meta><article-id pub-id-type="pmid">39995849</article-id><article-id pub-id-type="pmc">11848778</article-id><article-id pub-id-type="doi">10.21105/joss.07213</article-id><article-id pub-id-type="manuscript">HHSPA2055895</article-id><article-categories><subj-group subj-group-type="heading"><subject>Article</subject></subj-group></article-categories><title-group><article-title>BART-Survival: A Bayesian machine learning approach to survival analyses in Python</article-title></title-group><contrib-group><contrib contrib-type="author"><contrib-id contrib-id-type="orcid" authenticated="false">http://orcid.org/0009-0001-6265-913X</contrib-id><name><surname>Tiegs</surname><given-names>Jacob</given-names></name><xref rid="A1" ref-type="aff">1</xref><xref rid="A2" ref-type="aff">2</xref></contrib><contrib contrib-type="author"><contrib-id contrib-id-type="orcid" authenticated="false">http://orcid.org/0009-0006-1840-6991</contrib-id><name><surname>Raykin</surname><given-names>Julia</given-names></name><xref rid="A1" ref-type="aff">1</xref><xref rid="CR1" ref-type="corresp">&#x000b6;</xref></contrib><contrib contrib-type="author"><contrib-id contrib-id-type="orcid" authenticated="false">http://orcid.org/0000-0001-7680-6965</contrib-id><name><surname>Rochlin</surname><given-names>Ilia</given-names></name><xref rid="A1" ref-type="aff">1</xref><xref rid="CR1" ref-type="corresp">&#x000b6;</xref></contrib></contrib-group><aff id="A1"><label>1</label>Inform and Disseminate Division, Office of Public Health Data, Surveillance, and Technology, Centers for Disease Control and Prevention, Atlanta, Georgia, United States of America</aff><aff id="A2"><label>2</label>Metas Solutions, Atlanta, Georgia, United States of America</aff><author-notes><corresp id="CR1"><label>&#x000b6;</label>Corresponding author</corresp></author-notes><pub-date pub-type="nihms-submitted"><day>9</day><month>2</month><year>2025</year></pub-date><pub-date pub-type="ppub"><day>28</day><month>1</month><year>2025</year></pub-date><pub-date pub-type="pmc-release"><day>24</day><month>2</month><year>2025</year></pub-date><volume>10</volume><issue>105</issue><elocation-id>10.21105/joss.07213</elocation-id><permissions><license><ali:license_ref xmlns:ali="http://www.niso.org/schemas/ali/1.0/" specific-use="textmining" content-type="ccbylicense">https://creativecommons.org/licenses/by/4.0/</ali:license_ref><license-p>Authors of papers retain copyright and release the work under a Creative Commons Attribution 4.0 International License (<ext-link ext-link-type="uri" xlink:href="https://creativecommons.org/licenses/by/4.0/">CC BY 4.0</ext-link>).</license-p></license></permissions><abstract id="ABS1"><title>Summary</title><p id="P1"><monospace>BART-Survival</monospace> is a Python package that allows time-to-event (survival) analyses in discrete-time using the non-parametric machine learning algorithm, Bayesian Additive Regression Trees (BART). <monospace>BART-Survival</monospace> combines the performance of the BART algorithm with the complementary data and model formatting required to complete the survival analyses. The library contains a convenient application programming interface (API) that allows a simple approach when using the library for survival analyses, while maintaining capabilities for added complexity when desired. The package is intended for analysts exploring use of flexible non-parametric alternatives to traditional (semi-)parametric survival analyses.</p></abstract></article-meta></front><body><sec id="S1"><title>Statement of need</title><p id="P2">Survival analyses are a cornerstone of public health and clinical research in such diverse fields as cancer, cardiovascular disease, and infectious diseases (<xref rid="R2" ref-type="bibr">Altman &#x00026; Bland, 1998</xref>; <xref rid="R3" ref-type="bibr">Bradburn et al., 2003</xref>). Traditional parametric and semi-parametric statistical methods, such as the Cox proportional hazards model, are commonly employed for survival analyses (<xref rid="R5" ref-type="bibr">Cox, 1972</xref>). However, these methods have several limitations, particularly when applied to complex data. One major issue is the need for restrictive assumptions, such as proportional hazards and predefined functional forms, which may not hold true in complex, real-world healthcare data (<xref rid="R6" ref-type="bibr">Harrell, 2015</xref>; <xref rid="R7" ref-type="bibr">Ishwaran et al., 2008</xref>). Additionally, these methods often struggle with high-dimensional datasets, leading to problems with over-fitting, multi-collinearity, and dealing with complex interactions (<xref rid="R7" ref-type="bibr">Ishwaran et al., 2008</xref>; <xref rid="R8" ref-type="bibr">Joffe et al., 2013</xref>).</p><p id="P3">More recently, non-parametric machine learning approaches have been introduced to address the limitations of the traditional methods (<xref rid="R6" ref-type="bibr">Harrell, 2015</xref>; <xref rid="R7" ref-type="bibr">Ishwaran et al., 2008</xref>). BART is a one such approach that has demonstrated exceptional performance across a variety of analytic settings, typically outperforming the traditional methods in terms of predictive accuracy. BART&#x02019;s performance is linked to it ability to flexibly model complex non-linear and variable interactions within the data, while being inherently regularized to reduce issues of over-fitting. The BART method is fully non-parametric and can adaptively model data complexities without prior knowledge or specification of a particular functional form. Finally, the method is generally accepted as being a user-friendly machine learning approach, as it typically requires minimal hyperparameter tuning and the outcomes can be easier to interpret than those produced by other similar methods (<xref rid="R4" ref-type="bibr">Chipman et al., 2010</xref>; <xref rid="R11" ref-type="bibr">R. Sparapani et al., 2021</xref>; <xref rid="R10" ref-type="bibr">R. A. Sparapani et al., 2016</xref>).</p><p id="P4">Currently, the only BART survival algorithm readily available exists as part of the <monospace>BART</monospace> R package, which contains a library of various BART-based approaches in addition to a BART survival analysis application (<xref rid="R11" ref-type="bibr">R. Sparapani et al., 2021</xref>; <xref rid="R10" ref-type="bibr">R. A. Sparapani et al., 2016</xref>). The <monospace>BART-Survival</monospace> package described here combines the survival analysis approach outlined in the <monospace>BART</monospace> R package with the foundational Python-based probabilistic programming language library, <monospace>PyMC</monospace> (<xref rid="R1" ref-type="bibr">Abril-Pla et al., 2023</xref>), and the accompanying BART algorithm from the PyMC-<monospace>BART</monospace> library (<xref rid="R9" ref-type="bibr">Quiroga et al., 2023</xref>). Our aim in developing BART-Survival is to provide accessibility to the <monospace>BART survival</monospace> algorithm within the Python programming language. This contribution is beneficial for analysts when Python is the preferred programming language, the analytic workflow is Python-based, or when the R language is unavailable for analyses.</p><p id="P5">The need for a complete <monospace>BART-Survival</monospace> python package is given by the simple fact that the BART survival algorithm is non-trivial to implement. Both the required data transformations and the internal model definition requires precise implementations to ensure generation of accurate survival models. Our <monospace>BART-Survival</monospace> library provides accessibility to these precise methods while removing the technical barriers that would limit user adoption of the BART survival approach.</p><p id="P6">More specifically, the <monospace>BART-Survival</monospace> library abstracts away the complexities of generating the proper training and inference datasets, which are conceptually complex and prone to being specified incorrectly if implemented from scratch. Similarly, the <monospace>BART-Survival</monospace> library provides a pre-specified internal Bayesian model using the <monospace>PyMC</monospace> probabilistic programming language. This pre-specified model is primarily accessed through the <monospace>BART-Survival</monospace> API removing the requirement for users to have more than a cursory knowledge of the <monospace>PyMC</monospace> or <monospace>PyMC-BART</monospace> libraries. Since the <monospace>BART-Survival</monospace> package is intended for students and professional in the public health and clinical fields, it is expected that users of the <monospace>BART-Survival</monospace> library will not have extensive programming expertise, adding to the need for a fully self-contained and accessible approach.</p><p id="P7">In summary, the <monospace>BART-Survival</monospace> package provides a simple and accessible approach to implementing the BART survival algorithm. The provided approach can be beneficial for users who are looking for non-parametric alternatives to traditional (semi-)parametric survival analysis. The BART survival algorithm can be especially useful in large, complex healthcare data, where machine learning methods can demonstrate improved performance over the traditional methods.</p></sec><sec id="S2"><title>Conclusion</title><p id="P8"><monospace>BART-Survival</monospace> provides the computational methods required for completing non-parametric discrete-time survival analysis. This approach can have several advantages over alternative survival methods. These advantages include capabilities to incorporate non-linear and interaction effects into the model, naturally ability to regularize the model (which reduces the risk of over-fitting) and of being robust to issues of multi-collinearity. The <monospace>BART-Survival</monospace> approach is especially useful when the assumptions of alternative survival methods are violated.</p><p id="P9">Our <monospace>BART-Survival</monospace> algorithm has been tested in a rigorous simulation study, with additional applications to real-world data. While the manuscript for this work is currently under development, the results indicate similar performance as the the R-based BART survival method across settings of varied complexity. Both methods demonstrate the previously describe advantages over other survival approaches (such as Cox Proportional Hazard Models) when the relationships within the data becomes more complex or assumptions of the these other models are violated. A comparison of the R-based method and our <monospace>BART-Survival</monospace> algorithm is included in the <ext-link xlink:href="https://github.com/CDCgov/BART-Survival/blob/main/examples/pbart_rbart_comparison/lung.ipynb" ext-link-type="uri">examples folder of the Github repository</ext-link>.</p><p id="P10">Our library provides a convenient API for completing discrete-time survival analysis, along with the functionality to customize the methodology as needed. The associated API documentation can be found <ext-link xlink:href="https://cdcgov.github.io/BART-Survival/build/html/index.html" ext-link-type="uri">here</ext-link>, along with the associated Github repository <ext-link xlink:href="https://github.com/CDCgov/BART-Survival" ext-link-type="uri">BART-Survival</ext-link>. An extended review of the methods is additionally provided within the documentation and can be found <ext-link xlink:href="https://cdcgov.github.io/BART-Survival/build/html/methods.html" ext-link-type="uri">here</ext-link>.</p></sec></body><back><ack id="S3"><title>Acknowledgements</title><p id="P11">We thank Oscar Rinc&#x000f3;n-Guevara for helpful suggestions and review. We also thank Tegan Boehmer, Sachin Agnihotri, and Matt Ritchey for supporting the project throughout its development.</p></ack><ref-list><title>References</title><ref id="R1"><mixed-citation publication-type="journal"><name><surname>Abril-Pla</surname><given-names>O</given-names></name>, <name><surname>Andreani</surname><given-names>V</given-names></name>, <name><surname>Carroll</surname><given-names>C</given-names></name>, <name><surname>Dong</surname><given-names>L</given-names></name>, <name><surname>Fonnesbeck</surname><given-names>CJ</given-names></name>, <name><surname>Kochurov</surname><given-names>M</given-names></name>, <name><surname>Kumar</surname><given-names>R</given-names></name>, <name><surname>Lao</surname><given-names>J</given-names></name>, <name><surname>Luhmann</surname><given-names>CC</given-names></name>, <name><surname>Martin</surname><given-names>OA</given-names></name>, <name><surname>Osthege</surname><given-names>M</given-names></name>, <name><surname>Vieira</surname><given-names>R</given-names></name>, <name><surname>Wiecki</surname><given-names>T</given-names></name>, &#x00026; <name><surname>Zinkov</surname><given-names>R</given-names></name> (<year>2023</year>). <article-title>PyMC: A modern, and comprehensive probabilistic programming framework in Python</article-title>. <source>PeerJ Computer Science</source>, <volume>9</volume>, <fpage>e1516</fpage>. <pub-id pub-id-type="doi">10.7717/peerj-cs.1516</pub-id></mixed-citation></ref><ref id="R2"><mixed-citation publication-type="journal"><name><surname>Altman</surname><given-names>DG</given-names></name>, &#x00026; <name><surname>Bland</surname><given-names>JM</given-names></name> (<year>1998</year>). <article-title>Statistics Notes: Time to event (survival) data</article-title>. <source>BMJ</source>, <volume>317</volume>(<issue>7156</issue>), <fpage>468</fpage>&#x02013;<lpage>469</lpage>. <pub-id pub-id-type="doi">10.1136/bmj.317.7156.468</pub-id><pub-id pub-id-type="pmid">9703534</pub-id>
</mixed-citation></ref><ref id="R3"><mixed-citation publication-type="journal"><name><surname>Bradburn</surname><given-names>MJ</given-names></name>, <name><surname>Clark</surname><given-names>TG</given-names></name>, <name><surname>Love</surname><given-names>SB</given-names></name>, &#x00026; <name><surname>Altman</surname><given-names>DG</given-names></name> (<year>2003</year>). <article-title>Survival Analysis Part II: Multivariate data analysis &#x02013; an introduction to concepts and methods</article-title>. <source>British Journal of Cancer</source>, <volume>89</volume>(<issue>3</issue>), <fpage>431</fpage>&#x02013;<lpage>436</lpage>. <pub-id pub-id-type="doi">10.1038/sj.bjc.6601119</pub-id><pub-id pub-id-type="pmid">12888808</pub-id>
</mixed-citation></ref><ref id="R4"><mixed-citation publication-type="journal"><name><surname>Chipman</surname><given-names>HA</given-names></name>, <name><surname>George</surname><given-names>EI</given-names></name>, &#x00026; <name><surname>McCulloch</surname><given-names>RE</given-names></name> (<year>2010</year>). <article-title>BART: Bayesian additive regression trees</article-title>. <source>The Annals of Applied Statistics</source>, <volume>4</volume>(<issue>1</issue>). <pub-id pub-id-type="doi">10.1214/09-AOAS285</pub-id></mixed-citation></ref><ref id="R5"><mixed-citation publication-type="journal"><name><surname>Cox</surname><given-names>DR</given-names></name> (<year>1972</year>). <article-title>Regression Models and Life-Tables</article-title>. <source>Journal of the Royal Statistical Society Series B: Statistical Methodology</source>, <volume>34</volume>(<issue>2</issue>), <fpage>187</fpage>&#x02013;<lpage>202</lpage>. <pub-id pub-id-type="doi">10.1111/j.2517-6161.1972.tb00899.x</pub-id></mixed-citation></ref><ref id="R6"><mixed-citation publication-type="book"><name><surname>Harrell</surname><given-names>FE</given-names></name> (<year>2015</year>). <source>Regression Modeling Strategies: With Applications to Linear Models, Logistic and Ordinal Regression, and Survival Analysis</source>. <publisher-name>Springer International Publishing</publisher-name>. <pub-id pub-id-type="doi">10.1007/978-3-319-19425-7</pub-id></mixed-citation></ref><ref id="R7"><mixed-citation publication-type="journal"><name><surname>Ishwaran</surname><given-names>H</given-names></name>, <name><surname>Kogalur</surname><given-names>UB</given-names></name>, <name><surname>Blackstone</surname><given-names>EH</given-names></name>, &#x00026; <name><surname>Lauer</surname><given-names>MS</given-names></name> (<year>2008</year>). <article-title>Random survival forests</article-title>. <source>The Annals of Applied Statistics</source>, <volume>2</volume>(<issue>3</issue>). <pub-id pub-id-type="doi">10.1214/08-AOAS169</pub-id></mixed-citation></ref><ref id="R8"><mixed-citation publication-type="journal"><name><surname>Joffe</surname><given-names>E</given-names></name>, <name><surname>Coombes</surname><given-names>KR</given-names></name>, <name><surname>Qiu</surname><given-names>YH</given-names></name>, <name><surname>Yoo</surname><given-names>SY</given-names></name>, <name><surname>Zhang</surname><given-names>N</given-names></name>, <name><surname>Bernstam</surname><given-names>EV</given-names></name>, &#x00026; <name><surname>Kornblau</surname><given-names>SM</given-names></name> (<year>2013</year>). <article-title>Survival Prediction In High Dimensional Datasets &#x02013; Comparative Evaluation Of Lasso Regularization and Random Survival Forests</article-title>. <source>Blood</source>, <volume>122</volume>(<issue>21</issue>), <fpage>1728</fpage>&#x02013;<lpage>1728</lpage>. <pub-id pub-id-type="doi">10.1182/blood.V122.21.1728.1728</pub-id></mixed-citation></ref><ref id="R9"><mixed-citation publication-type="journal"><name><surname>Quiroga</surname><given-names>M</given-names></name>, <name><surname>Garay</surname><given-names>PG</given-names></name>, <name><surname>Alonso</surname><given-names>JM</given-names></name>, <name><surname>Loyola</surname><given-names>JM</given-names></name>, &#x00026; <name><surname>Martin</surname><given-names>OA</given-names></name> (<year>2023</year>). <source>Bayesian additive regression trees for probabilistic programming (No. arXiv:2206.03619). arXiv</source>. <pub-id pub-id-type="doi">10.48550/arXiv.2206.03619</pub-id></mixed-citation></ref><ref id="R10"><mixed-citation publication-type="journal"><name><surname>Sparapani</surname><given-names>RA</given-names></name>, <name><surname>Logan</surname><given-names>BR</given-names></name>, <name><surname>McCulloch</surname><given-names>RE</given-names></name>, &#x00026; <name><surname>Laud</surname><given-names>PW</given-names></name> (<year>2016</year>). <article-title>Nonparametric survival analysis using Bayesian Additive Regression Trees (BART)</article-title>. <source>Statistics in Medicine</source>, <volume>35</volume>(<issue>16</issue>), <fpage>2741</fpage>&#x02013;<lpage>2753</lpage>. <pub-id pub-id-type="doi">10.1002/sim.6893</pub-id><pub-id pub-id-type="pmid">26854022</pub-id>
</mixed-citation></ref><ref id="R11"><mixed-citation publication-type="journal"><name><surname>Sparapani</surname><given-names>R</given-names></name>, <name><surname>Spanbauer</surname><given-names>C</given-names></name>, &#x00026; <name><surname>McCulloch</surname><given-names>R</given-names></name> (<year>2021</year>). <article-title>Nonparametric Machine Learning and Efficient Computation with Bayesian Additive Regression Trees: The <bold>BART</bold>
<italic toggle="yes">R</italic> Package</article-title>. <source>Journal of Statistical Software</source>, <volume>97</volume>(<issue>1</issue>). <pub-id pub-id-type="doi">10.18637/jss.v097.i01</pub-id></mixed-citation></ref></ref-list></back></article>