[Paper Review] SurvLIMEpy: A Python package implementing SurvLIME
This paper introduces SurvLIMEpy, the first open-source Python package implementing the SurvLIME algorithm for local interpretability in survival analysis. It enables feature importance estimation for diverse survival models—including Cox, Random Survival Forest, DeepHit, and DeepSurv—by fitting a local Cox model to perturbed neighbors, with experiments showing accurate recovery of true feature effects on simulated and real datasets.
In this paper we present SurvLIMEpy, an open-source Python package that implements the SurvLIME algorithm. This method allows to compute local feature importance for machine learning algorithms designed for modelling Survival Analysis data. Our implementation takes advantage of the parallelisation paradigm as all computations are performed in a matrix-wise fashion which speeds up execution time. Additionally, SurvLIMEpy assists the user with visualization tools to better understand the result of the algorithm. The package supports a wide variety of survival models, from the Cox Proportional Hazards Model to deep learning models such as DeepHit or DeepSurv. Two types of experiments are presented in this paper. First, by means of simulated data, we study the ability of the algorithm to capture the importance of the features. Second, we use three open source survival datasets together with a set of survival algorithms in order to demonstrate how SurvLIMEpy behaves when applied to different models.
Motivation & Objective
- Address the lack of interpretable machine learning tools for survival analysis in Python, particularly for black-box models.
- Provide a flexible, efficient implementation of the SurvLIME algorithm to explain predictions of survival models locally around individual patients.
- Support a wide range of survival models, from classical methods like Cox Proportional Hazards to deep learning models such as DeepHit and DeepSurv.
- Enable users to customize neighbor generation, distance metrics, and Monte Carlo sampling strategies for robust local explanations.
- Demonstrate the method’s validity on both simulated and real-world survival datasets, showing alignment with true feature effects.
Proposed method
- Generate perturbed neighbors around a test individual using user-defined sampling strategies and distance metrics.
- Obtain survival predictions from the black-box model on the neighbors and use them as targets for a local Cox Proportional Hazards model.
- Fit a local Cox model by minimizing the distance between black-box predictions and local model predictions, using matrix-wise computation for speed.
- Extract feature importance as coefficients from the local Cox model, providing a time-aware explanation of feature contributions.
- Support parallelization and vectorized operations to accelerate computation across multiple test instances.
- Integrate visualization tools to display feature importance and model behavior across time, enhancing interpretability.

Experimental results
Research questions
- RQ1Can SurvLIMEpy accurately recover true feature importance in simulated survival data with known ground-truth coefficients?
- RQ2How well does SurvLIMEpy perform in explaining predictions from diverse survival models, including deep learning architectures like DeepHit and DeepSurv?
- RQ3To what extent do SurvLIME coefficients align with coefficients from a global Cox model on real-world survival datasets?
- RQ4How does SurvLIMEpy’s performance vary under different neighbor generation strategies and distance metrics?
- RQ5Can SurvLIMEpy provide stable and meaningful local explanations across multiple Monte Carlo simulations on test individuals?
Key findings
- On simulated data, SurvLIMEpy correctly identified features 'two' and 'three' as most important, with median coefficients of 0.0711 and -0.1251, respectively, closely matching the true values of 0.1 and -0.15.
- For the LUNG dataset, SurvLIME coefficients showed strong correlation with global Cox model coefficients, with a median absolute difference of 0.024 across all features.
- On the Veteran dataset, SurvLIME correctly identified 'karno' and 'celltype_squamous' as top contributors, with median SurvLIME coefficients of -0.5251 and -0.3690, respectively, aligning with the global Cox model.
- DeepSurv and DeepHit achieved c-index values of 0.70 and 0.68 on simulated data, indicating acceptable predictive performance, which SurvLIMEpy successfully explained.
- The SurvLIME coefficients from DeepSurv were stable across 100 Monte Carlo simulations, with minimal deviation from the median, confirming robustness.
- Visualization tools in SurvLIMEpy effectively illustrated time-dependent feature importance, supporting clinical interpretability of model decisions.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.