lifelines: survival analysis in Python
Cameron Davidson-Pilon · The Journal of Open Source Software · 2019
One frustration of data scientists and statisticians is moving between programming languages to complete projects.The most common two are R and Python.For example, a survival analysis model may be fit using R's survival-package (Terry M Therneau, 2015) or flexsurv (Christopher Jackson, 2016), but needs to be deployed into a Python system.Previously, this may have meant using Python libraries to call out to R (still shuffling between two languages, but now abstracted), or translating the fitted model to Python (likely to introduce bugs).Libraries like Patsy (Nathaniel J. Smith et al., 2018) and Statsmodels (Skipper Seabold et al., 2017) have helped data scientists and statisticians work in solely in Python.lifelines extends the toolbox of data scientists so they can perform common survival analysis tasks in Python.Its value comes from its intuitive and well documented API, its flexibility in modeling novel hazard functions, and its easy deployment in production systems & research stations along side other Python libraries.The internals of lifelines uses some novel approaches to survival analysis algorithms like automatic differentiation and meta-algorithms.We present high-level descriptions of these novel approaches next.