Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Explainable Machine Learning in Survival Analysis

License

NotificationsYou must be signed in to change notification settings

ModelOriented/survex

Repository files navigation

R-CMD-checkCodecov test coverageCRAN statusTotal downloadsDrWhy-BackBone

Overview

Survival analysis is a task dealing with time-to-event prediction. Aside from the well-understood models like CPH, many more complex models have recently emerged, but most lack interpretability. Due to a functional type of prediction, either in the form of a survival function or a cumulative hazard function, standard model-agnostic explanations cannot be applied directly.

Thesurvex package provides model-agnostic explanations for machine learning survival models. It is based on theDALEX package. If you're unfamiliar with explainable machine learning, consider referring to theExplanatory Model Analysis book -- most of the methods included insurvex extend these described in EMA and implemented inDALEX but to models with functional output.

The mainexplain() function uses a model and data to create a standardizedexplainer object, which is further used as an interface for calculating predictions. We automate creating explainers from the following packages:mlr3proba,censored,ranger,randomForestSRC, andsurvival.Raise an Issue on GitHub if you find models from other packages that we can incorporate into theexplain() interface.

Note that an explainer can be created forany survival model, using theexplain_survival() function by passingmodel,data,y, andpredict_survival_function arguments.

Installation

The package is available onCRAN:

install.packages("survex")

The latest development version can be installed from GitHub usingdevtools::install_github():

devtools::install_github("https://github.com/ModelOriented/survex")

Simple demo

library("survex")library("survival")library("ranger")# create a modelmodel<- ranger(Surv(time,status)~.,data=veteran)# create an explainerexplainer<- explain(model,data=veteran[,-c(3,4)],y= Surv(veteran$time,veteran$status))# evaluate the modelmodel_performance(explainer)# visualize permutation-based feature importanceplot(model_parts(explainer))# explain one prediction with SurvSHAP(t)plot(predict_parts(explainer,veteran[1,-c(3,4)]))

Functionalities and roadmap

Existing functionalities:

  • unified prediction interface using the explainer object -predict()
  • calculation of performance metrics (Brier Score, Time-dependent C/D AUC, metrics frommlr3proba) -model_performance()
  • calculation of feature importance (Permutation Feature Importance - PFI) -model_parts()
  • calculation of partial dependence (Partial Dependence Profiles - PDP, Accumulated Local Effects - ALE) -model_profile()
  • calculation of 2-dimensional partial dependence (2D PDP, 2D ALE) -model_profile_2d()
  • calculation of local feature attributions (SurvSHAP(t), SurvLIME) -predict_parts()
  • calculation of local ceteris paribus explanations (Ceteris Paribus profiles - CP/ Individual Conditional Expectations - ICE) -predict_profile()
  • calculation of global feature attributions using SurvSHAP(t) -model_survshap()

Currently in develompment:

  • ...

Future plans:

  • ... (raise an Issue on GitHub if you have any suggestions)
  • examples for sursvm and survboost (#88)

Usage

survex usage cheatsheet

Citation

If you usesurvex, please citeour article:

M. Spytek, M. Krzyziński, S. H. Langbein, H. Baniecki, M. N. Wright, P. Biecek.survex: an R package for explaining machine learning survival models.Bioinformatics, Volume 39, Issue 12, btad723, 2023.

@article{spytek2023survex,    author  = {Mikołaj Spytek and Mateusz Krzyziński and Sophie Hanna Langbein and                Hubert Baniecki and Marvin N Wright and Przemysław Biecek},    title   = {survex: an {R} package for explaining machine learning survival models},    journal = {Bioinformatics},    volume  = {39},    number  = {12},    pages   = {btad723},    year    = {2023},    month   = {12},    doi     = {10.1093/bioinformatics/btad723}}

Applications ofsurvex

Related work


[8]ページ先頭

©2009-2025 Movatter.jp