SurvLIME: A method for explaining machine learning survival models

03/18/2020 ∙ by Maxim S. Kovalev, et al. ∙ 0

A new method called SurvLIME for explaining machine learning survival models is proposed. It can be viewed as an extension or modification of the well-known method LIME. The main idea behind the proposed method is to apply the Cox proportional hazards model to approximate the survival model at the local area around a test example. The Cox model is used because it considers a linear combination of the example covariates such that coefficients of the covariates can be regarded as quantitative impacts on the prediction. Another idea is to approximate cumulative hazard functions of the explained model and the Cox model by using a set of perturbed points in a local area around the point of interest. The method is reduced to solving an unconstrained convex optimization problem. A lot of numerical experiments demonstrate the SurvLIME efficiency.

READ FULL TEXT VIEW PDF
POST COMMENT

Comments

There are no comments yet.

Authors

page 1

page 2

page 3

page 4

This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

Many complex problems in various applications are solved by means of deep machine learning models, in particular deep neural networks, at the present time. One of the demonstrative examples is the disease diagnosis by the models on the basis of medical images or another medical information. At the same time, deep learning models often work as black-box models such that details of their functioning are often completely unknown. It is difficult to explain in this case how a certain result or decision is achieved. As a result, the machine learning models meet some difficulties in their incorporating into many important applications, for example, into medicine, where doctors have to have an explanation of a stated diagnosis in order to choose a corresponding treatment. The lack of the explanation elements in many machine learning models has motivated development of many methods which could interpret or explain the deep machine learning algorithm predictions and understand the decision-making process or the key factors involved in the decision

[4, 18, 35, 36].

The methods explaining the black-box machine learning models can be divided into two main groups: local methods which derive explanation locally around a test example; global methods which try to explain the overall behavior of the model. A key component of explanations for models is the contribution of individual input features. It is assumed that a prediction is explained when every feature is assigned by some number quantified its impact on the prediction. One of the first local explanation methods is the Local Interpretable Model-agnostic Explanations (LIME) [43], which uses simple and easily understandable linear models to locally approximate the predictions of black-box models. The main intuition of the LIME is that the explanation may be derived locally from a set of synthetic examples generated randomly in the neighborhood of the example to be explained such that every synthetic example has a weight according to its proximity to the explained example. Moreover, the method uses simple and easily understandable models like decision rules or linear models to locally or globally approximate the predictions of black-box models. The method is agnostic to the black-box model. This means that any details of the black-box model are unknown. Only its input and the corresponding output are used for training the explanation model. It is important to mention a work [16], which provides a thorough theoretical analysis of the LIME.

The LIME as well as other methods have been successfully applied to many machine learning models for explanation. However, to the best of our knowledge, there is a large class of models for which there are no explanation methods. These models are applied to problems which take into account survival aspects of applications. Survival analysis as a basis for these models can be regarded as a fundamental tool which is used in many applied areas especially in medicine. The survival models can be divided into three parts: parametric, nonparametric and semiparametric [23, 56]

. Most machine learning models are based on nonparametric and semiparametric survival models. One of the popular regression model for the analysis of survival data is the well-known Cox proportional hazards model, which is a semi-parametric model that calculates effects of observed covariates on the risk of an event occurring, for example, the death or failure

[11]. The proportional hazards assumption in the Cox model means that different examples (patients) have hazard functions that are proportional, i.e., the ratio of the hazard functions for two examples with different prognostic factors or covariates is a constant and does not vary with time. The model assumes that a patient’s log-risk of failure is a linear combination of the example covariates. This is a very important peculiarity of the Cox model, which will be used below in explanation models.

A lot of machine learning implementations of survival analysis models have been developed [56] such that most implementations (random survival forests, deep neural networks) can be regarded as black-box models. Therefore, the problem of the survival analysis result explanation is topical. However, in contrast to other machine learning models, one of the main difficulties of the survival model explanation is that the result of most survival models is a time-dependent function (the survival function, the hazard function, the cumulative hazard function, etc.). This implies that many available explanation methods like LIME cannot be applied to survival models. In order to cope with this difficulty, a new method called SurvLIME (Survival LIME) for explaining machine learning survival models is proposed, which can be viewed as an extension or modification of LIME. The main idea of the proposed method is to apply the Cox proportional hazards model to approximate the survival model at a local area around a test example. It has been mentioned that the Cox model considers a linear combination of the example covariates. Moreover, it is important that the covariates as well as their combination do not depend on time. Therefore, coefficients of the covariates can be regarded as quantitative impacts on the prediction. However, we approximate not a point-valued black-box model prediction, but functions, for example, the cumulative hazard function (CHF). In accordance with the proposed explanation method, synthetic examples are randomly generated around the explainable example, and the CHF is calculated for every synthetic example by means of the black-box survival model. Simultaneously, we write the CHF corresponding to the approximating Cox model as a function of the coefficients of interest. By writing the distance between the CHF provided by the black-box survival model and the CHF of the approximating Cox model, we construct an unconstrained convex optimization problem for computing the coefficients of covariates. Numerical results using synthetic and real data illustrate the proposed method.

The paper is organized as follows. Related work can be found in Section 2. A short description of basic concepts of survival analysis, including the Cox model, is given in Section 3. Basic ideas of the method LIME are briefly considered in Section 4. Section 5 provides a description of the proposed SurvLIME and its basic ideas. A formal derivation of the convex optimization problem for determining important features and a scheme of an algorithm implementing SurvLIME can be found in Section 6. Numerical experiments with synthetic data are provided in Section 7. Similar numerical experiments with real data are given in Section 8. Concluding remarks are provided in Section 9.

2 Related work

Local explanation methods. A lot of methods have been developed to locally explain black-box models. Along with the original LIME [43], many its modifications have been proposed due to success and simplicity of the method, for example, ALIME [47], NormLIME [2], DLIME [62], Anchor LIME [44], LIME-SUP [24], LIME-Aleph [40], GraphLIME [25]. Another very popular method is the SHAP [49]

which takes a game-theoretic approach for optimizing a regression loss function based on Shapley values

[33]. Alternative methods are influence functions [31], a multiple hypothesis testing framework [9], and many other methods.

An increasingly important family of methods are based on counterfactual explanations [54], which try to explain what to do in order to achieve a desired outcome by means of finding changes to some features of an explainable input example such that the resulting data point called counterfactual has a different specified prediction than the original input. Due to intuitive and human-friendly explanations provided by this family of methods, it is extended very quickly [17, 22, 32, 52]. Counterfactual modifications of LIME have been also proposed by Ramon et al. [41] and White and Garcez [57].

Many aforementioned explanation methods starting from LIME [43] are based on perturbation techniques [14, 15, 39, 53]. These methods assume that contribution of a feature can be determined by measuring how prediction score changes when the feature is altered [12]. One of the advantages of perturbation techniques is that they can be applied to a black-box model without any need to access the internal structure of the model. A possible disadvantage of perturbation technique is its computational complexity when perturbed input examples are of the high dimensionality.

Descriptions of many explanation methods and various approaches, their critical reviews can be found in survey papers [1, 3, 10, 18, 45].

It should be noted that most explanation methods deal with the point-valued predictions produced by black-box models. We mean under point-valued predictions some finite set of possible model outcomes, for example, classes of examples. A main problem of the considered survival models is that their outcome is a function. Therefore, we try to propose a new approach, which uses LIME as a possible tool for its implementing, dealing with CHFs as the model outcomes.

Machine learning models in survival analysis. A review of survival analysis methods is presented by Wang et al. [56]. The Cox model is a very powerful and popular method for dealing with survival data. Therefore, a lot of approaches modifying the Cox model have been proposed last decades. In particular, Tibshirani [51] proposed a modification of the Cox model based on the Lasso method in order to take into account a high dimensionality of survival data. Following this paper, several modifications of the Lasso methods for the Cox model were introduced [27, 30, 50, 59, 63]. In order to relax the linear relationship assumption accepted in the Cox model, a simple neural network as well as the deep neural networks were proposed by several authors [13, 19, 28, 42, 64]. The SVM approach to survival analysis has been also studied by several authors [6, 29, 48, 58]

. It turned out that the random survival forests (RSFs) became a very powerful, efficient and popular tool for the survival analysis. Therefore, this tool and its modifications, which can be regarded as extensions of the standard random forest

[8] on survival data, were proposed and investigated in many papers, for example, in [26, 34, 37, 38, 46, 55, 60, 61], in order to take into account the limited survival data.

Most of the above models dealing with survival data can be regarded as black-box models and should be explained. However, only the Cox model has a simple explanation due to its linear relationship between covariates. Therefore, it can be used to approximate more powerful models, including survival deep neural networks and RSFs, in order to explain predictions of these models.

3 Some elements of survival analysis

3.1 Basic concepts

In survival analysis, an example (patient) is represented by a triplet , where

is the vector of the patient parameters (characteristics) or the vector of the example features;

is time to event of the example. If the event of interest is observed, then corresponds to the time between baseline time and the time of event happening, in this case , and we have an uncensored observation. If the example event is not observed and its time to event is greater than the observation time, then corresponds to the time between baseline time and end of the observation, and the event indicator is , and we have a censored observation. Suppose a training set consists of triplets ,

. The goal of survival analysis is to estimate the time to the event of interest

for a new example (patient) with feature vector denoted by by using the training set .

The survival and hazard functions are key concepts in survival analysis for describing the distribution of event times. The survival function denoted by as a function of time

is the probability of surviving up to that time, i.e.,

. The hazard function is the rate of event at time given that no event occurred before time , i.e.,

(1)

where is the density function of the event of interest.

By using the fact that the density function can be expressed through the survival function as

(2)

we can write the following expression for the hazard rate:

(3)

Another important concept in survival analysis is the CHF , which is defined as the integral of the hazard function and can be interpreted as the probability of an event at time given survival until time , i.e.,

(4)

The survival function is determined through the hazard function and through the CHF as follows:

(5)

The dependence of the above functions on a feature vector is omitted for short.

To compare survival models, the C-index proposed by Harrell et al. [21] is used. It estimates how good a survival model is at ranking survival times. It estimates the probability that, in a randomly selected pair of examples, the example that fails first had a worst predicted outcome. In fact, this is the probability that the event times of a pair of examples are correctly ranking.

3.2 The Cox model

Let us consider main concepts of the Cox proportional hazards model, [23]. According to the model, the hazard function at time given predictor values is defined as

(6)

Here is a baseline hazard function which does not depend on the vector and the vector ; is the covariate effect or the risk function; is an unknown vector of regression coefficients or parameters. It can be seen from the above expression for the hazard function that the reparametrization is used in the Cox model. The function in the model is linear, i.e.,

(7)

In the framework of the Cox model, the survival function is computed as

(8)

Here is the cumulative baseline hazard function; is the baseline survival function. It is important to note that functions and do not depend on and .

The partial likelihood in this case is defined as follows:

(9)

Here is the set of patients who are at risk at time . The term “at risk at time ” means patients who die at time or later.

4 Lime

Before studying the LIME modification for survival data, this method is briefly considered below.

LIME proposes to approximate a black-box model denoted as with a simple function in the vicinity of the point of interest , whose prediction by means of has to be explained, under condition that the approximation function belongs to a set of explanation models , for example, linear models. In order to construct the function in accordance with LIME, a new dataset consisting of perturbed samples is generated, and predictions corresponding to the perturbed samples are obtained by means of the explained model. New samples are assigned by weights in accordance with their proximity to the point of interest by using a distance metric, for example, the Euclidean distance.

An explanation (local surrogate) model is trained on new generated samples by solving the following optimization problem:

(10)

Here is a loss function, for example, mean squared error, which measures how the explanation is close to the prediction of the black-box model; is the model complexity.

A local linear model is the result of the original LIME. As a result, the prediction is explained by analyzing coefficients of the local linear model.

5 A basic sketch of SurvLIME

Suppose that there are available a training set and an black-box model. For every new example , the black-box model with input produces the corresponding output in the form of the CHF or the hazard function . The basic idea behind the explanation algorithm SurvLIME is to approximate the output of the black-box model in the form of the CHF by means of the CHF produced by the Cox model for the same input example . The idea stems from the fact that the function in the Cox model (see (6)) is linear and does not depend on time . The linearity means that coefficients of the covariates in can be regarded as quantitative impacts on the prediction. Hence, the largest coefficients indicate the corresponding importance features. The independence of on time means that time and covariates can be considered separately, and the optimization problem minimizing the difference between CHFs is significantly simplifies.

In order to find the important features of , we have to compute some optimal values of elements of vector (see the previous section) of the Cox model such that would be as close as possible to the Cox CHF denoted as . However, the use of a single point may lead to incorrect results. Therefore, we generate a lot of nearest points in a local area around . For every generated point , the CHF of the black-box model can be computed as a prediction provided by the survival black-box model, and the Cox CHF can be written as a function of unknown vector . Now the optimal values of can be computed by minimizing the average distance between every pair of CHFs and over all generated points . Every distance between CHFs has a weight which depends on the distance between and . Smaller distances between and produce larger weights of distances between CHFs. If explanation methods like LIME deal with point-valued predictions of the example processing through the black-box model, then the proposed method is based on functions characterizing every point from or new points . Fig. 1 illustrates the explanation algorithm. It can be seen from Fig. 1 that a set of examples are fed to the black-box survival model, which produces a set of CHFs . Simultaneously, we write CHFs , , as functions of coefficients for all generated examples. The weighted average distance between the CHFs of the Cox model and the black-box survival model allows us to construct an optimization problem and to compute the optimal vector by solving the optimization problem.

Figure 1: A schematic illustration of the explanation algorithm

It should be noted that the above description is only a sketch where every step is a separate task. All steps will be considered in detail below.

6 Minimization of distances between functions

It has been mentioned that the main peculiarity of machine learning survival models is that the output of models is a function (the CHF or the survival function). Therefore, in order to approximate the output of the black-box model by means of the CHF produced by the Cox model at the input example , we have to generate many points in a local area around and to consider the mean distance between the CHFs for generated points , , and the Cox model CHF for point . Before deriving the mean distance and its minimizing, we introduce some notations and conditions.

Let be the distinct times to event of interest, for example, times to deaths from the set , where and . The black-box model maps the feature vectors into piecewise constant CHFs having the following properties:

  1. for all

Let us introduce the time in order to restrict the integral of , where is a very small positive number. Let . Then we can write

(11)

Since the CHF is piecewise constant, then it can be written in a special form. Let us divide the set into subsets such that

  1. , ,

  2. for

Let us introduce the indicator functions

(12)

Hence, the CHF can be expressed through the indicator functions as follows:

(13)

under additional condition , where is a small positive number. Here is a part of the CHF in interval . It is important that does not depend on and is constant in interval . The last condition will be necessary below in order to deal with logarithms of the CHFs.

Let be a monotone function. Then there holds

(14)

By using the above representation of the CHF and integrating it over , we get

(15)

The same expressions can be written for the Cox CHF:

(16)

It should be noted that the distance between two CHFs can be replaced with the distance between two logarithms of the corresponding CHFs for the optimization problem. The introduced condition allows to use logarithms. Therefore, in order to get the convex optimization problem for finding optimal values of , we consider logarithms of the CHFs. It is important to point out that the difference of logarithms of the CHFs is not equal to the difference between CHFs themselves. However, we make this replacement to simplify the optimization problem for computing important features.

Let and be logarithms of and . Here is a generated point. The difference between functions and can be written as follows:

(17)

Let us consider the distance between functions and in metric :

(18)

The function is linear with and, therefore, convex. Moreover, it is easy to prove by taking the second derivative over that the function is also convex, where . Since the term is positive, then the function is also convex as a linear combination of convex functions with positive coefficients.

According to the explanation algorithm, we have to consider many points generated in a local area around and to minimize the objective function , which takes into account all these generated examples and the corresponding weights of the examples. It is obvious that this function is also convex with respect to . The weight can be assigned to point as a decreasing function of the distance between and , for example, , where is a kernel. In numerical experiments, we use the function defined in (24).

Finally, we write the following convex optimization problem:

(19)

One of the difficulties of solving the above problem is that the difference between functions and may be significantly different from the distance between their logarithms. Therefore, in order to take into account this fact, it is proposed to introduce weights which “straighten” functions and . These weights are defined as

(20)

Taking into account these weights and their representation , the optimization problem can be rewritten as

(21)

The problem can be solved by many well-known methods of the convex programming.

Finally, we write the following scheme of Algorithm 1.

0:  Training set ; point of interest ; the number of generated points ; the black-box survival model for explaining
0:  Vector of important features
1:  Compute the baseline cumulative hazard function of the approximating Cox model on dataset by using the Nelson–Aalen estimator
2:  Generate random nearest points in a local area around , point is the -th point
3:  Get the prediction of the cumulative hazard function by using the black-box survival model (the function )
4:  Compute weights of perturbed points,
5:  Compute weights , ,
6:  Find vector by solving the convex optimization problem (21)
Algorithm 1 The algorithm for computing vector for point

7 Numerical experiments with synthetic data

In order to study the proposed explanation algorithm, we generate random survival times to events by using the Cox model estimates. This generation allows us to compare initial data for generating every points and results of SurvLIME.

7.1 Generation of random covariates, survival times and perturbations

Two clusters of covariates

are randomly generated such that points of every cluster are generated from the uniform distribution in a sphere. The covariate vectors are generated in the

-sphere with some predefined radius . The center of the -sphere and its radius are parameters of experiments. There are several methods for the uniform sampling of points in the -sphere with the unit radius , for example, [5, 20]. Then every generated point is multiplied by . The following parameters for points of every cluster are used:

  1. cluster 0: center ; radius ; number of points ;

  2. cluster 1: center ; radius ; number of points .

The parameters of clusters are chosen in order to get some intersecting area containing points from both the clusters, in particular, the radius is determined from the centers as follows:

(22)

The clusters after using the well-known t-SNE algorithm are depicted in Fig. 2.

In order to generate random survival times by using the Cox model estimates, we apply results obtained by Bender et al. [7] for survival time data for the Cox model with Weibull distributed survival times. The Weibull distribution with the scale and shape parameters is used to generate appropriate survival times for simulation studies because this distribution shares the assumption of proportional hazards with the Cox regression model [7]. Taking into account the parameters and of the Weibull distribution, we use the following expression for generated survival times [7]:

(23)

where

is the random variable uniformly distributed in interval

.

Parameters of the generation for every cluster are

  1. cluster 0: , , ;

  2. cluster 1: , , .

It can be seen from the above that every vector has three almost zero-valued elements and two “large” elements which will correspond to important features. Generated values are restricted by the condition: if , then is replaced with value . The event indicator

is generated from the binomial distribution with probabilities

, .

Figure 2: Two clusters of generated covariates depicted by using the t-SNE method

Perturbation is one of the steps of the algorithm. According to it, we generate nearest points in a local area around . These points are uniformly generated in the -sphere with some predefined radius and the center at point . In numerical experiments, . Weights to every point are assigned as follows:

(24)

7.2 Black-box models and approximation measures

As black-box models, we use the Cox model and the RSF model [26]. The RSF consists of decision survival trees. The approximating Cox model has the baseline CHF constructed on generated training data using the Nelson–Aalen estimator. The Cox model is used in order to check whether the selected important features explaining the CHF at point coincide with the corresponding features accepted in the Cox model for generating training set. It should be noted that the Cox model as well as the RSF are viewed as black-box models whose predictions (CHFs or survival functions) are explained. To study how different cases impact on the quality of the approximation, we use the following two measures for the Cox model:

(25)
(26)

where are coefficients of the Cox model which is used as the black-box model; are coefficients used for training data generation (see (23)); are explaining coefficients obtained by using the proposed algorithm.

The first measure characterizes how the obtained important features coincide with the corresponding features obtained by using the Cox model as the black-box model. The second measure considers how the obtained important feature coincide with the features used for generating the random times to events. Every measure is calculated by taking randomly points from the testing set and compute the corresponding coefficients.

In order to investigate the quality of explanation when the black-box model is the RSF, we use another measure:

(27)

where is a set of time indices for computing the measure.

This measure considers how the obtained Cox model approximation is close to the RSF output . We cannot estimate the proximity of important features explaining the model because we do not have the corresponding features for the RSF. A comparison of the important features with the generated ones is also incorrect because we explain the model (the RSF) output (), but not training data. Therefore, we use the above measure to estimate the proximity of two CHFs: the Cox model approximation and the RSF output.

7.3 Experiment 1

To evaluate the algorithm, 900 examples are randomly selected from every cluster for training and 100 examples are for testing. Three cases of training and testing the black-box Cox and RSF models are studied:

  1. cluster 0 for training and for testing;

  2. cluster 1 for training and for testing;

  3. clusters 0 and 1 are jointly used for training and separately for testing.

The testing phase includes:

  • Computing the explanation vector for every point from the testing set.

  • Depicting the best, mean and worst approximations in accordance with Euclidean distance between vectorsd and (for the Cox model) and with Euclidean distance between and (for the RSF). In order to get these approximations, points with the best, mean and worst approximations are selected among all testing points.

  • Computing measures and for the Cox model and for the RSF over all points of the testing set.

The three cases (best (pictures in the first row), mean (pictures in the second row) and worst (pictures in the third row)) of approximations for the black-box Cox model under condition that cluster 0 is used for training and testing are depicted in Fig. 3. Left pictures show values of important features , and . It can be seen from these pictures that all experiments show very clear coincidence of important features for all models. Right pictures in Fig. 3 show survival functions obtained from the black-box Cox model and from the Cox approximation. It follows from the pictures that the approximation is perfect even for the worst case. Similar results can be seen from Fig. 4, where training and testing examples are taken from cluster 1.

Figure 3: The best, mean and worst approximations for the Cox model (training and testing sets from cluster 0)
Figure 4: The best, mean and worst approximations for the Cox model (training and testing sets from cluster 1)

Figs. 5 and 6 illustrate different results corresponding to cases when training examples are taken from cluster 0 and cluster 1. One can see that the approximation of survival functions is perfect, but important features obtained by SurvLIME do not coincide with the features used for generating random times in accordance with the Cox model. This fact can be explained in the following way. We try to explain the CHF obtained by using the black-box model (the Cox model in the considered case). But the black-box Cox model is trained on all examples from two different clusters. We have a mix of data from two clusters with different parameters. Therefore, this model itself provides results different from the generation model. At the same time, one can observe from Figs. 5 and 6 that the explaining important features coincide with the features which are obtained from the black-box Cox model. These results are interesting. They show that we explain CHFs of the black-box model, but not CHFs of training data.

Figure 5: The best, mean and worst approximations for the Cox model (the training set from clusters 0,1 and the testing set from cluster 0)
Figure 6: The best, mean and worst approximations for the Cox model (the training set from clusters 0,1 and the testing set from cluster 1)

The approximation accuracy measures for four cases are given in Table 1. In fact, the table repeats the results shown in Figs. 3-6.

Clusters for Cluster for
training testing
Table 1: Approximation accuracy measures for four cases of using the black-box Cox model

In the same way, we study the black-box RSF model by using three cases of its training and testing. The results are shown in Fig. 7 where the first, second, third, and fourth rows correspond to the four cases of experiments: cluster 0 for training and for testing; cluster 1 for training and for testing; clusters 0 and 1 are jointly used for training and separately for testing. Every row contains pairs of survival functions corresponding to the best, mean and worst approximations. The important features are not shown in Fig. 7 because they cannot be compared with the features of the generative Cox model. Moreover, the RSF does not provide the important features like the Cox model. One can again see from Fig. 7 that SurvLIME illustrates the perfect approximation of the RSF output by the Cox model.

Figure 7: The best, mean and worst approximations for the RSF model

7.4 Experiment 2

In the second experiment, our aim is to study how SurvLIME depends on the number of training examples. We use only the Cox model for explaining which is trained on , , , , examples and tested on examples from cluster 0. We study how the difference between and depends of the sample size. Results of experiments are shown in Fig. 8 where rows correspond to , , , , training examples, respectively, left pictures illustrate relationships between important features, right pictures show survival functions obtained from the black-box Cox model and from the Cox approximation (see similar pictures in Figs. 3-6). It is interesting to observe in Fig. 8 how the vectors , and approach each other with the number of training examples.

Figure 8: Comparison of important features (left pictures) and survival functions (right pictures) for the black-box Cox model by , , , , training examples

The measures and as functions of the sample size are provided in Table 2. It can be seen from Table 2 a tendency of the measures to be reduced with increase of the sample size for training. The C-index as a measure of the black-box model quality is also given in Table 2.

C-index
Table 2: Approximation accuracy measures for four cases of using the black-box Cox model

7.5 Experiment 3

Another interesting question for studying is how SurvLIME behaves by a very small amount of training data. We use the Cox model and the RSF as black-box models and train them on , , , examples from cluster 0. The models are tested on examples from cluster 0. Results of experiments for the Cox model are shown in Fig. 9 where rows correspond to , , , training examples, respectively, left pictures illustrate relationships between important features, right pictures show survival functions obtained from the black-box Cox model and from the Cox approximation (see similar pictures in Figs. 8). It is interesting to points out from Fig. 9 that important features obtained by means of SurvLIME differ from the parameters of the Cox model for generating random examples in the case of training examples. However, they almost coincide with features obtained by the black-box model. Moreover, it follows from Fig. 9 that important features of SurvLIME quickly converge to parameters of the Cox model for generating random examples.

Figure 9: Comparison of important features (left pictures) and survival functions (right pictures) for the black-box Cox model by , , , training examples

The C-index, measures and as functions of the sample size are provided in Table 3. It can be seen from Table 3 that and are strongly reduced with increase of the sample size.

C-index
Table 3: Approximation accuracy measures for four cases of using the black-box Cox model by the small amount of data

Results of experiments for the RSF are shown in Fig. 10 where rows correspond to , , , training examples, respectively, left pictures illustrate important features, right pictures show survival functions obtained from the black-box RSF and from the Cox approximation (see similar pictures in Fig. 9). It can be seen from Fig. 10 that the difference between survival functions is reduced with increase the training set. However, in contrast to the black-box Cox model (see Fig. 9), important features are very unstable. They are different for every training sets. A reason of this important feature behavior is that they explain the RSF outputs which are significantly changed by the so small numbers of training examples.

Figure 10: Important features (left pictures) and survival functions (right pictures) for the black-box RSF by , , , training examples

8 Numerical experiments with real data

In order to illustrate SurvLIME, we test it on several well-known real datasets. A short introduction of the benchmark datasets are given in Table 4 that shows sources of the datasets (R packages), the number of features for the corresponding dataset, the number of training instances and the number of extended features using hot-coding for categorical data.

Data set Abbreviation R Package
Chronic Myelogenous Leukemia Survival CML multcomp
NCCTG Lung Cancer LUNG survival
Primary Biliary Cirrhosis PBC survival
Stanford Heart Transplant Stanford2 survival
Trial Of Usrodeoxycholic Acid UDCA survival
Veterans’ Administration Lung Cancer Study Veteran survival
Table 4: A brief introduction about datasets

Figs. 11-12 illustrate numerical results for the CML dataset. Three cases of approximation are considered: best (pictures in the first row), mean (pictures in the second row) and worst (pictures in the third row). These cases are similar to cases studied for synthetic data. The cases are studied for the black-box Cox model (Fig. 11) and the black-box RSF (Fig. 12). Again left pictures in figures show values of important features and for the Cox model and for the RSF, right pictures illustrate the approximated survival function and the survival function obtained by the explained model.

Figs. 13-17 show numerical results for other datasets. Since most results are very similar to the same results obtained for the CML datasets, then we provide only the case of the mean approximation for every dataset in order to reduce the number of similar pictures. Moreover, we do not show important features explaining RSFs because, in contrast to the Cox model, they cannot be compared with true features. Every figure consists of three pictures: the first one illustrates the explanation important features and important features obtained from training the Cox model; the second picture shows two survival functions for the Cox model; the third picture shows two survival functions for the RSF.

If the Cox model is used for training, then one can see an explicit coincidence of explaining important features and the features obtained from the trained Cox model for all datasets. This again follows from the fact that SurvLIME does not explain a dataset. It explains the model, in particular, the Cox model. We also can observe that the approximated survival function is very close to the survival function obtained by the explained Cox model in all cases. The same cannot be said about the RSF. For example, one can see from Fig. 12 that the important features obtained by explaining the RSF mainly do not coincide. The reason is a difference of results provided by the Cox model and the RSF. At the same time, it can be seen from Figs. 12-17 that the survival functions obtained from the RSF and the approximating Cox model are close to each other for many models. This implies that SurvLIME provides correct results.

Figure 11: The best, mean and worst approximations for the Cox model trained on the CML dataset
Figure 12: The best, mean and worst approximations for the RSF trained on the CML dataset
Figure 13: The mean approximation for the Cox model (the first and the second picture) and the RSF (the third picture) trained on the LUNG dataset
Figure 14: The mean approximation for the Cox model (the first and the second picture) and the RSF (the third picture) trained on the PBC dataset
Figure 15: The mean approximation for the Cox model (the first and the second picture) and the RSF (the third picture) trained on the Stanford2 dataset
Figure 16: The mean approximation for the Cox model (the first and the second picture) and the RSF (the third picture) trained on the UDCA dataset
Figure 17: The mean approximation for the Cox model (the first and the second picture) and the RSF (the third picture) trained on the Veteran dataset

9 Conclusion

A new explanation method called SurvLIME which can be regarded as a modification of the well-known method LIME for survival data has been presented in the paper. The main idea behind the method is to approximate a survival machine learning model at a point by the Cox proportional hazards model which assumes a linear combination of the example covariates. This assumption allows us to determine the important features explaining the survival model.

In contrast to LIME and other explanation methods, SurvLIME deals with survival data. It is not complex from computational point of view. Indeed, we have derived a simple convex unconstrained optimization problem whose solution does not meet any difficulties. Moreover, many numerical experiments with synthetic and real datasets have clearly illustrated accuracy and correctness of SurvLIME. It has coped even with problems characterizing by small datasets.

The main advantage of the method is that it opens a door for developing many explanation methods taking into account censored data. In particular, an interesting problem is to develop a method explaining the survival models with time-dependent covariates. This is a direction for further research. Only the quadratic norm has been considered to estimate the distance between two CHFs and to construct the corresponding optimization problem. However, there are other distance metrics which are also interesting with respect to constructing new explanation methods. This is another direction for further research. An open and very interesting direction is also the counterfactual explanation with censored data. It could be a perspective extension of SurvLIME. It should be noted that SurvLIME itself can be further investigated by considering its different parameters, for example, the assignment of weights of perturbed examples in different ways, the robustness of the method to outliers, etc. The original Cox model has several modifications based on the Lasso method. These modifications could improve the explanation method in some applications, for example, in medicine applications to take into account a high dimensionality of survival data. This is also a direction for further research.

Acknowledgement

The reported study was funded by RFBR, project number 20-01-00154.

References