Conditional feature importance for mixed data
Abstract
EconStor is a publication server for scholarly economic literature, provided as a non-commercial public service by the ZBW.
Full text
Blesch, Kristin; Watson, David S.; Wright, Marvin N. Article — Published Version Conditional feature importance for mixed data AStA Advances in Statistical Analysis Provided in Cooperation with: Springer Nature Suggested Citation: Blesch, Kristin; Watson, David S.; Wright, Marvin N. (2023) : Conditional feature importance for mixed data, AStA Advances in Statistical Analysis, ISSN 1863-818X, Springer, Berlin, Heidelberg, Vol. 108, Iss. 2, pp. 259-278, https://doi.org/10.1007/s10182-023-00477-9 This Version is available at: https://hdl.handle.net/10419/308997 Standard-Nutzungsbedingungen: Die Dokumente auf EconStor dürfen zu eigenen wissenschaftlichen Zwecken und zum Privatgebrauch gespeichert und kopiert werden. Sie dürfen die Dokumente nicht für öffentliche oder kommerzielle Zwecke vervielfältigen, öffentlich ausstellen, öffentlich zugänglich machen, vertreiben oder anderweitig nutzen. Sofern die Verfasser die Dokumente unter Open-Content-Lizenzen (insbesondere CC-Lizenzen) zur Verfügung gestellt haben sollten, gelten abweichend von diesen Nutzungsbedingungen die in der dort genannten Lizenz gewährten Nutzungsrechte. Terms of use: Documents in EconStor may be saved and copied for your personal and scholarly purposes. You are not to copy documents for public or commercial purposes, to exhibit the documents publicly, to make them publicly available on the internet, or to distribute or otherwise use the documents in public. If the documents have been made available under an Open Content Licence (especially Creative Commons Licences), you may exercise further usage rights as specified in the indicated licence. https://creativecommons.org/licenses/by/4.0/
Vol.:(0123456789) AStA Advances in Statistical Analysis (2024) 108:259–278 https://doi.org/10.1007/s10182-023-00477-9 1 3 ORIGINAL PAPER Conditional feature importance formixed data KristinBlesch1,2 · DavidS.Watson3· MarvinN.Wright1,2,4 Received: 6 October 2022 / Accepted: 28 March 2023 / Published online: 29 April 2023 © The Author(s) 2023 Abstract Despite the popularity of feature importance (FI) measures in interpretable machine learning, the statistical adequacy of these methods is rarely discussed. From a statistical perspective, a major distinction is between analysing a variable’s importance before and after adjusting for covariates—i.e., between marginal and conditional measures. Our work draws attention to this rarely acknowledged, yet crucial distinction and showcases its implications.We find that few methods are available for testing conditional FI and practitioners have hitherto been severely restricted in method application due to mismatched data requirements. Most real-world data exhibits complex feature dependencies and incorporates both continuous and categorical features (i.e.,mixed data). Both properties are oftentimes neglected by conditional FI measures. To fill this gap, we propose to combine the conditional predictive impact (CPI) framework with sequential knockoff sampling. The CPI enables conditional FI measurement that controls for any feature dependencies by sampling valid knockoffs—hence, generating synthetic data with similar statistical properties—for the data to be analysed. Sequential knockoffs were deliberately designed to handle mixed data and thus allow us to extend the CPI approach to such datasets. We demonstrate through numerous simulations and a real-world example that our proposed workflow controls type I error, achieves high power, and is in-line with results given by other conditional FI measures, whereas marginal FI metrics canresult in misleading interpretations. Our findings highlight the necessity of developing statistically adequate, specialized methods for mixed data. Keywords Interpretable machine learning· Feature importance· Knockoffs· Explainable artificial intelligence * Kristin Blesch [email protected] Extended author information available on the last page of the article
260 K.Blesch et al. 1 3 1 Introduction Interpretable machine learning is on the rise as practitioners become interested in not only achieving high prediction accuracy in supervised learning tasks, but also understanding why certain predictions were made. Evaluating the importance of input variables (features) to the target prediction plays a crucial role in facilitating such endeavours. Several feature importance (FI) measures have been proposed by the machine learning community, but differing conceptualizations are spread across the literature. We identify at least five dichotomies that orient FI methods: (1) global vs. local; (2) model-agnostic vs. model-specific; (3) testing vs. scoring; (4) methods that do and do not accommodate mixed tabular data; and (5) conditional vs. marginal measures. This defines a grid with 25=32 cells that helps categorize FI measures. For example, the popular SHAP algorithm (Lundberg and Lee 2017) produces local, model-agnostic FI scores that can accommodate mixed data and measures marginal FI. We emphasize that there is no “ideal” configuration of these five options—each is the right answer to a different question that is irreducibly context-dependent. However, this grid helps identify a notable lacuna: There are few global, modelagnostic FI methods that accommodate mixed data with error control for conditional FI measurement. Explaining the dichotomies in more detail, local FI measures (Lundberg and Lee 2017; Ribeiro etal. 2016) are optimized for a particular point or region of the feature space, e.g., a single observation, while global FI scores (Fisher etal. 2019; Friedman 2001) measure a variable’s overall importance. Model-specific measures (Breiman 2001; Kursa and Rudnicki 2010; Shrikumar etal. 2017) exploit the properties of a particular function class for more efficient or precise FI calculation, while modelagnostic measures (Apley and Zhu 2020; Ribeiro etal. 2018) treat the underlying model as a black box. Testing methods include some inference procedure for error control (Lei etal. 2018), while scoring methods (Covert etal. 2020) do not. Some methods are proposed with limited applicability to certain data types, e.g. only continuous inputs (Watson and Wright 2021), while others are more flexible (Molnar etal. 2023). We discuss a selection of FI methods briefly in Sect.2, but refer readers to review papers on FI interpretability methods, e.g. Linardatos etal. (2021), for a wider discussion on the topic. Through the lens of statistics, the division (5), conditional vs. marginal measures, is particularly important, yet insufficiently acknowledged in both literature and practice(Apley and Zhu 2020; Hooker etal. 2021; Molnar etal. 2023; Watson and Wright 2021). The complementary concepts become evident when relating the statistical conception of independence testing to the machine learning view on FI measurement. We can think of the marginal null hypothesis as testing whether the input feature Xj is independent of other covariates X−j or the target variable Y: On the other hand, testing against (2) accounts for the covariates X−j and hence corresponds to conditional FI: (1) HM 0 ∶X j ⟂⟂ {Y,X −j}
261 1 3 Conditional feature importance formixed data These tests clearly target different objectives. In this setup, we have HM 0 entailing HC 0 , but not the other way around. However, this strength comes with a certain loss of specificity, because rejecting HM 0 leaves it unclear whether Xj is correlated with Y, X−j , or both. The relationship between FI and independence testing sheds light on another aspect, which may even be considered another dichotomy: does the FI measure aim for investigating the model behaviour or the underlying data structure (Chen etal. 2020)? For example, conditional independence tests that are part of some conditional FI measures (Watson and Wright 2021) may be used for causal structure learning, which often is based on repeated conditional independence testing (Glymour etal. 2019). Therefore, conditional FI measurescan help explain the underlying data structure, whereas marginal FI measures differentiate between variables the predictive model relies on, which can be used to evaluate the fairness of a model. This does not preclude practitioners from using marginal and conditional FI measures in conjunction, and since marginal measures are often faster to compute, they might be preferable for quick assessments in large pipelines with many iterations. However, practitioners must be careful to interpret these measures properly and not infer a conditional signal from a marginal test. In Fig. 1, we illustrate the difference between marginal (permutation feature importance (PFI), Fisher etal. 2019, Breiman 2001) and conditional (conditional predictive impact with Gaussian knockoffs (CPIgauss), Watson and Wright2021) FI (2) HC 0 ∶X j ⟂⟂ Y∣X −j Fig. 1 Boxplots contrasting marginal and conditional FI metrics for a prediction of Y with C and X ( N=200 ) through a random forest prediction model across 1000 replicates. The conditional FI measure attributes no importance to X, whereas the marginal measure attributes nonzero importance to X because (due to induced correlation between X and Y by C) it is predictive of Y
262 K.Blesch et al. 1 3 measures. In this example, the confounding variable C is a commoncause of both X and Y. This causal structure induces spuriouscorrelation between X and Y, leading the marginal FI measure to attribute nonzero importance values to both C and Xin predicting Y. On the contrary, the conditional FI measure attributes nonzero FI only toC, since X has no additional predictive value for Y above C. This paper explores global, model-agnostic FI methods that accommodate mixed data with error control for conditional FI measurement. This is not a niche problem: mixed tabular data is the norm in many important areas such as health care, economics, and industry, and inference procedures are essential for decision-making in high risk domains to minimize costly errors. With the proliferation of machine learning algorithms, model-agnostic approaches can help standardize FI tasks without recalibrating to a particular function class for each new application. Conditional, global measures are valuable when practitioners seek mechanistic understanding that takes data covariance into account and go beyond individual model outputs. Even though the empirical relevance of this kind of FI measurement is eminent, specialized methods are lacking. Some FI methods have yet to be evaluated in mixed data settings (Covert etal. 2020; Molnar etal. 2023; Lei etal. 2018), while others are currently inapplicable to mixed data (Watson and Wright 2021). The consequences of neglecting the special nature of mixed data for conditional FI measurement remain unexplored, and therefore practitioners currently have no guidance on how to proceed with conditional FI measurement in such cases, which proves a severe limitation in real-world applications. We propose to combine the conditional predictive impact (CPI) testing framework proposed by Watson and Wright (2021) with the use of sequential knockoffs (Kormaksson etal. 2021) in order to enable conditional, global, model-agnostic FI testing for mixed data. CPI is a flexible, model-agnostic tool that relies on the usage of so-called knockoffs (Candès etal. 2018). In short, knockoffs are synthetic variables that carry over themajor statistical properties of the original variables, such as the correlation structure among covariates. While Watson and Wright (2021) claim that the CPI should in principle work with any valid set of knockoffs, it has thus far only been applied and evaluated with Gaussian knockoffs (Candès etal. 2018). This currently limits practitioners to using the CPI method only with continuous variables or to disregard the specialities of mixed data. We analyse consequences of such a disregard when using CPI with Gaussian knockoffs (Candès etal. 2018) (CPIgauss) and deep knockoffs (Romano etal. 2020) (CPIdeep) and propose a specialized solution strategy to tackle the mixed data case: using sequential knockoffs (Kormaksson etal. 2021)—a knockoff sampling algorithm explicitly developed for mixed data—within the CPI framework (CPIseq). The paper will be structured as follows. We present relevant methodology and FI measures in Sect.2. Section2.2 reviews several knockoff sampling algorithms,demonstrating the need for specialized procedures with mixed data and motivating our proposed solution CPIseq. Through simulation studies in Sects.3.1 and 3.2, we will evaluate our newly proposed workflow in more depth and further compare it to other methods. Finally, we illustrate method application to a real-world dataset in Sect.3.3 before concluding and discussing our findings in Sect.4.
263 1 3 Conditional feature importance formixed data 2 Methods With a focus on the measurement of model-agnostic, global, conditional FI, this section presents related measures proposed by previous literature and discusses their applicability to mixed data. We acknowledge that methods from the statistical literature on conditional independence testing (Shah and Peters 2020; Williamson etal. 2021) might also be utilized for conditional FI measurement; however, a full comparison of such methods is beyond the scope of this paper. Further, it is worth clarifying at this point that we understand FI here as a concept that is tied to the variable’s effect on the predictive performance in a supervised learning task. 2.1 Feature importance measures 2.1.1 Conditional subgroup approach (CS) A global, model-agnostic FI measure that acknowledges the crucial distinction between conditional and marginal measures of importance is the conditional subgroup (CS) approach proposed by Molnar etal. (2023). CS partitions the data into interpretable subgroups, i.e., groups whose feature distributions are homogeneous within but heterogeneous between groups. The method is promising, as it explicitly specifies the conditioning between subgroups and further allows for an unconditional interpretation within subgroups. This means the method provides both a global conditional and a within-group unconditional interpretation, which sheds light on featuredependence structures. To determine FI, CS evaluates the change in loss when the variable of interest is permuted within subgroups, which lowers extrapolation to low-densityregionsof the feature space, thereby mitigating a common problem with permutation-based approaches (Hooker etal. 2021). To decide on a suitable partition, the authors suggest determining subgroups via transformation trees. Using a pre-specified loss function, the average increase in loss is reported for multiple permutations versus the original ordering of variables. CS is not affected by mixed data other than through the choice of an appropriate prediction algorithm, which is why this method is suspected to work equally well with mixed data. However, for this approach to work, researchers must assume that the data are separable into subgroups. Further, for testing FI, the method would need to rely on computationally expensive permutation tests as no inherent testing procedure is provided. 2.1.2 Leave‑one‑covariate‑out (LOCO) Leave-one-covariate-out (LOCO) is a fairly simple approach to measuring FI, which, as the name suggests, evaluates the change in predictive performance of a model when leaving out a covariate of interest (Lei etal. 2018). This means, FI is
264 K.Blesch et al. 1 3 determined by comparing the loss of the model fitted including or excluding the covariate of interest. While this is a very intuitive approach, it does involve several drawbacks. First, the model has to be retrained with a different set of variables, which not only incurs high computational cost, but also yields an entirely different model, raising concerns about comparability in general. Further, if correlations or other complex dependencies are present within the data, LOCO might give misleading results if only one covariate at a time is excluded, as this neglects potential interaction effects between groups of variables. In the presence of such group-wise structures, the exclusion of multiple covariates at a time is advisable (Au etal. 2022; Rinaldo etal. 2016). For the speciality of mixed data, we can again see that all reliance is on the level of model choice, hence, as long as the prediction model is able to process mixed data, LOCO is not affected by different data types. 2.1.3 Shapley additive global importance (SAGE) Shapley additive global importance (SAGE) (Covert etal. 2020) is a model-agnos- tic FI measure that aims to take into account feature interactions on a global level. The method is based on Shapley values (Shapley 1953), which have received much attention in interpretable machine learning recently. While Shapley values are widespread in their use for giving local explanations, i.e. explaining the role of features in individual predictions made by the model, Covert etal. (2020) propose a global extension such that the role of features can be understood on a model-wide level. SAGE values are Shapley values for the features with regard to the predictive power of the model. Therefore, SAGE values can also be calculated by directly calculating Shapley values for the model loss, e.g. as proposed in LossSHAP (Lundberg etal. 2020), and then average across all instances to achieve a global measure. However, Covert etal. (2020) propose a fast approximation algorithm. TheSAGEmethodology allows fortakingfeature interaction effects into account, however,in practice, implementations typicallyuse marginal sampling as an approximation to the conditional densities when sampling to replace the respective feature in various coalitions. This results in explanations that are comparableto marginal measures of FI when applied to real-world data. Mixed data affect SAGE at the variable sampling step to build the coalitions and through the choice of the predictive model. With the use of marginal imputation and a model that is able to process mixed data, SAGE should not be affected by mixed data types. 2.1.4 Conditional predictive impact (CPI) A fairly general approach to tackle conditional FI measurement is the conditional predictive impact (CPI) proposed by Watson and Wright (2021). To capture conditional FI, a flexible conditional independence test is introduced that works with any supervised learning algorithm, valid knockoff sampler and well-defined loss function. CPI ties FI to predictive performance, arguing that the inclusion of a relevant
265 1 3 Conditional feature importance formixed data variable in the model should improve its predictive performance. Building on this idea, first, a supervised learning algorithm is trained to predict the outcome from given input variables. Then, using a knockoff sampling algorithm, so-called knockoff copies of the input features are generated. These knockoffs retain the covariance structure of the input features,1 but are (conditional on the input features) independentof the response variable.They therefore serve asa set of negative controls against which to compare the original data. In detail, to compute the CPI statistic, the trained model from the first step is used to predict the target twice: first using the original test data, and again after replacing one or several features of interest in the test data by their knockoff copies. The change in loss is then averaged across samples. Finally, the authors propose to apply inference procedures, such as a paired t test, to get valid p-values and confidence intervals for the FI scores. Given that the prediction algorithm works with mixed data, sampling valid knockoffs for mixed data is the sticking point. As Watson and Wright (2021) claim, the CPI setup is knockoff-agnostic and hence works for any knockoff sampler. However, their simulations are limited to settings of continuous data and Gaussian knockoff sampling, i.e., using CPIgauss, only. Resulting from this, practitioners facing mixed data cannot use CPIgauss directly and are forced to use workaroundsthat may perform poorly in practice, e.g. dummy encoding variables and treating them as continuous, of which the effects on the method are thus far unknown. The present work sheds light on the consequences of such procedures, see further Sect. 3.1. To propose an efficient way of making CPI applicable to mixed data, we will now delve into the methodology of knockoffs in greater depth. 2.2 Model‑X knockoffs The model-X knockoff framework (Candès etal. 2018) was proposed for variable selection while controlling the false discovery rate (FDR). The idea is to use knockoffs as negative controls in the model, which prevents spuriously correlated variables from being detected as important. These knockoffs are a set of variables X that mimic the correlational structure between the original input variables X , but crucially are known to be irrelevant to the target variable Y, conditional on the input data. Intuitively, if Xj does not significantly outperform Xj by some importance measure, then Xj can be removed from the model (Candès etal. 2018). More formally, to constructa valid knockoff matrix X forthe p-dimensional feature matrix X , two conditions have to be met. The first is pairwise exchangeability, i.e. for any proper subset S⊂{1, …,p} : where d = represents equality in distribution and swap (S) indicates swapping the respective variables in S with their knockoff counterparts. The second condition is conditional independence, i.e. (3) ( X, X) swap(S) d =(X, X) , 1 This holds true for knockoffs that are at least of second-order, i.e. exhibit the same first two moments as the original data.
266 K.Blesch et al. 1 3 Knockoff methodology is an active field of research. Numerous approaches to knockoff sampling have been proposed, for example, methods based on distributional assumptions (Bates etal. 2021; Candès etal. 2018; Sesia etal. 2018), Bayesian frameworks (Gu and Yin 2021) or deep learning (Jordon etal. 2019; Liu and Zheng 2018; Romano etal. 2020; Sudarshan etal. 2020). While a comprehensive review of knockoff samplers is beyond the scope of this paper, we will present a selection of knockoff samplers that is particularly interesting for applications on mixed data. Namely, we will investigate Gaussian knockoffs (Candès etal. 2018) because of their widespread use, deep knockoffs (Romano etal. 2020) as a representative of deep learning based knockoff generation, and sequential knockoffs as a specialized approach to tackle mixed data. 2.2.1 Gaussian knockoffs As the name suggests, the Gaussian knockoff sampler (Candès etal. 2018) is based on the assumption that the input data matrix X∈ℝN×p is multivariate Gaussian, i.e. X∼N(𝜇,𝚺) . For simplicity, we assume μ= 0 and get forthe joint distribution which satisfies Eq.(3) with diagonal matrix diag{s} to ensure positive semi-definiteness of the joint covariance matrix G . Knockoffs can then be sampled from the conditional distribution X∣ X d =N(𝜇, V ) , where 𝜇,V can be calculated from regular regression formulas. For details see Candès etal. (2018). Clearly, it is reasonable to suspect this knockoff sampler to work well with Gaussian data. However, with mixed data types, discrete values can only be handled after encoding, e.g. introducing dummy variables, which are evidently non-Gaussian. The consequences of such transformations, i.e. neglecting the special nature of mixed data, have notyet been evaluated for the Gaussian knockoff sampler. In an attempt to quantify such implications to some extent, we will include this knockoff sampler in our analysis in Sect.3.1 and compare it to more well-suited alternatives. 2.2.2 Deep knockoffs Deep knockoffs as proposed by Romano et al. (2020) rely on a random generator, consisting of a deep neural network, to sample valid knockoffs. For variables X sampled independently from an unknown distribution PX , the random generator is trained such that the joint distribution of ( X , X ) is invariant under swapping, such that Eq.(3) is satisfied. In detail, the neural network takes variables X and i.i.d. sampled noise E as input to optimize a scoring function that quantifies the extent to which X is a good knockoff copy for X by evaluating how well Eq.(3) is approximated. Considering (4) X⟂⟂ Y∣ X . ( X, X)∼N(0, G), where G= [ 𝚺𝚺−diag{s} 𝚺−diag{s}𝚺 ]
273 1 3 Conditional feature importance formixed data top 6 variables in return leads to a relevant variable being ranked within the bottom 6 ranks. For example, due to the marginal measurement of FI, the PFI measure is ranking correlated yet irrelevant variables amongst the most important predictors (dashed line in Fig.4, Panel B), which in turn forces PFI to mistakenly rank some relevant variables low (solid line in Fig.4, Panel A). Regarding the comparison of CPI-based methods, we find CPIseq outperforming CPIgauss and CPIdeep in detecting relevant categorical variables in the mixed data setting, see Fig.4, Panel A, which underpins the findings of simulations in Sect.3.1. To check for robustness, we used several predictive models (generalized linear model, random forest, and neural network), varied the type of the target variable (regression or classification task) and the number of categories for the categorical variables (2, 5), and found similar results. Further, we analysed the fit of the prediction models on test data to ensure reliable FI measurement. See Supplementary Information C.4 and C.5 for details on the robustness analyses. In sum, this simulation demonstrates both that CPIseq is competitive with other conditional FI measures, and illustrates the importance of distinguishing between marginal and conditional measures. It is worth emphasizing again that the CPIseq workflow not only ranks features, but also enables powerful conditional FI testing. We will see the practical relevance of this in the following section. 3.3 Real‑world data We conclude the section on experiments with a real-world data application to illustrate our proposed workflow on empirical mixed data. As an example, we use the Fig. 5 Feature importance scores for predicting the selling price of diamonds using a random forest model. For the CPIseq and LOCO, t-tests are at 𝛼=5% , using the Holm procedure to adjust for multiple testing
274 K.Blesch et al. 1 3 diamonds dataset which is publicly available on OpenML5 (Vanschoren et al. 2014). Consisting of 9 covariates (6 numerical, 3 categorical) which relate to characteristics of diamonds such as length, depth and colour. We predict the sellingprice of the diamondin USD (price) using a random forest prediction model. Similar to the experiments in Sect.3.2, the importance of the covariates for the prediction model will be determined by CPIseq, CS, LOCO, PFI and SAGE. For further details on the dataset and the procedure, as well as a comparison to results given by another prediction model (neural network), see Supplementary Information D. Figure 5 illustrates the difference between conditional and marginal measures of feature importance. The marginal measures (Fig.5, PanelsD, E) attribute high importance scores to the covariates x_length, y_width, z_depth and carat, whereas the conditional measures (Fig.5, PanelsA, B, C) attribute high importance scores to the covariates colour, clarity and carat. Note that the scale of the FI measures in Fig.5 differs, since marginal measures also incorporate the importances of correlated variables and hence, by construction, exhibit much larger values than conditional FI measures. With some background knowledge on the physical characteristics of diamonds, we can understand the causal relationships that lead to this result. Carat is a measure of weight, and with round diamonds, this weight can be approximated by the formula carat =length ×width ×depth ×0.0061 (Miller 1988). Note that to ensure this formula holds, we only considered diamonds with a deviation <0.02 mm from a perfect round shape, yielding a subset of N=4463 observations. The covariates x_length, y_width and z_depth therefore determine the weight (carat), which all the importance measures suggest as an important predictor variable for price. Conditional FI measures then suggest that x_length, y_width and z_depth do not carry further information on the price, given the other covariates, including carat. Marginal measures, however, attribute importance irrespective of other covariates and hence do not condition on the information given by carat, which leads to high importance values for x_length, y_width, z_depth as well as carat, even though it is reasonable to assume that carat absorbs all relevant information given by x_length, y_width and z_depth on the price of diamonds. The conditional FI measures further detect the variables colour and clarity to be relevant for the prediction of price. Note that we here again have to see this in a conditional sense. Given the other covariates, the variables colour and clarity do provide additional information on the price, whereas marginal measures estimate a rather low importance of these variables. This real-world example emphasizes the difference between conditional and marginal FI measures and its implications. Again, it is worth repeating that out of the conditional measures, CPIseq facilitates the interpretation through inference procedures providing a clear indication of the relevant variables, whereas this indication is less clear with the LOCO testing procedure and CS not providing the user with testing procedures at all. 5 https:// www. openml. org/ search? type= data & sort= runs & id= 42225.
275 1 3 Conditional feature importance formixed data 4 Conclusion anddiscussion In this work, we highlight the importance of taking statistical considerations into account when measuring FI in interpretable machine learning. Specifically, we focus on conditional versus marginal perspectives on FI measurement, and analyse conditional FI methods with special regard for mixed data. We introduce the combination of CPI and sequential knockoffs (CPIseq) as a strategy that enables testing of conditional, model-agnostic, global FI with mixed data. Through simulation studies, we show that CPIseq achieves high power, whereas CPIgauss and CPIdeep are less sensitive for categorical features. Further, we benchmark this method against other conditional FI measures, finding competitive performance, and use a real-world data example to illustrate empirical implications. In sum, we demonstrate that the CPIseq provides researchers with a powerful test for conditional FI while working on a global, model-agnostic level. Our analyses are limited by the availability of specialized knockoff sampling algorithms for the generation of mixed data knockoffs. Astonishingly, the case of mixed data has not received much attention in the knockoff literature so far and even if some methods were claimed to generalize to the mixed data case (Romano etal. 2020), there is a lack ofconcrete methodology and software implementation. Also, the scarce availability of conditional FI measures that allow for effective statistical testing impedes efficient comparison between FI metrics, forcing the evaluation to rely on rankings. While rankings are oftentimes used in the literature on FI for illustrative purposes, a systematic gold standard for comparing rankings between methods has not emerged. We hypothesize that this might be due to the fact that in the machine learning community, simulation studies—a standard procedure in the statistics community—are relatively rare, and hence evaluations involving, e.g. ground truth variable rankings are not in the focus. In particular, with mixed data, a ground truth ranking of simulated variables is not straightforward since it is unclear how the categorical nature should be respected and challenging disagreements across methods are likely to occur (Krishna etal. 2022). Methodological development that bridges evaluation strategies commonly applied in statistics with the setting faced in interpretable machine learning, e.g. FI rankings, is highly desirable. This work highlights the necessity for procedures that respect data-specific requirements, such as respecting the categorical nature of variables in mixed datasets. Our simulations show that a neglect of such requirements and the application of workarounds might lead to undesirable consequences. We encourage researchers to develop methods that are specifically designed for realistic (mixed) data, instead of leaving practitioners with broad claims of the generalizability of their method. While some generalizations are indeed effortless, e.g. for conditional independence testing with all categorical data exact p-values can be computed through permutations (Tsamardinos and Borboudakis 2010), whereas conditional independence testing in general, including mixed data cases, is severely more challenging (Shah and Peters 2020). Moreover, other data type specific adjustments such as the presence of ordinal data might be of interest for future research, for example, random forest regression models yield the
276 K.Blesch et al. 1 3 same results with ordinal as with numeric data (Hastie etal. 2009) and hence FI methods that exploit model-specific advantages for ordinal data might be proposed. Further, the present work raises awareness of the fact that even though the concept of FI might sound intuitive at first, statistical perspectives on the problem reveal that, for example, the question of marginal in contrast to conditional measurement is of fundamental relevance. We hope this paper elucidates the potential of advancing interpretable machine learning methodology through statistical considerations, which might in turn be mutually beneficial for the future development of the field of explainable artificial intelligence and statistics. Supplementary Information The online version contains supplementary material available at https:// doi. org/ 10. 1007/ s10182- 023- 00477-9. Acknowledgements MNW and KB received funding for this project from the German Research Foundation (DFG), Emmy Noether Grant 437611051. Funding Open Access funding enabled and organized by Projekt DEAL. Data and code availability Data and code to reproduce all the results presented in this paper is available at https:// github. com/ bipshb/ CFI_ mixed Data. Declarations Conflict of interest MNW is associate editor of AStA—Advances in Statistical Analysis. KB and DSW declare no conflict of interest. Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http:// creat iveco mmons. org/ licen ses/ by/4. 0/. References Apley, D.W., Zhu, J.: Visualizing the effects of predictor variables in black box supervised learning models. J. R. Stat. Soc. Ser. B 82(4), 1059–1086 (2020). https:// doi. org/ 10. 1111/ rssb. 12377 Au, Q., Herbinger, J., Stachl, C., Bischl, B., Casalicchio, G.: Grouped feature importance and combined features effect plot. Data Min. Knowl. Disc. 36(4), 1401–1450 (2022). https:// doi. org/ 10. 1007/ s10618- 022- 00840-5 Bates, S., Candés, E., Janson, L., Wang, W.: Metropolized knockoff sampling. J. Am. Stat. Assoc. 116(535), 1413–1427 (2021). https:// doi. org/ 10. 1080/ 01621 459. 2020. 17291 63 Breiman, L.: Random forests. Mach. Learn. 45(1), 5–32 (2001). https:// doi. org/ 10. 1023/A: 10109 33404 324 Candès, E., Fan, Y., Janson, L., Lv, J.: Panning for gold: Model-free knockoffs for high-dimensional controlled variable selection. J. R. Stat. Soc. Ser. B (Stat. Methodol.) 80, 551–577 (2018). https:// doi. org/ 10. 1111/ rssb. 12265 Chen, H., Janizek, J.D., Lundberg, S., Lee, S.-I.: True to the model or true to the data? ArXiv preprint (2020). https:// doi. org/ 10. 48550/ arXiv. 2006. 16234
277 1 3 Conditional feature importance formixed data Covert, I., Lundberg, S.M., Lee, S.-I.: Understanding global feature contributions with additive importance measures. Adv. Neural Inf. Process. Syst. 33, 17212–17223 (2020) Fisher, A., Rudin, C., Dominici, F.: All models are wrong, but many are useful: learning a variable’s importance by studying an entire class of prediction models simultaneously. J. Mach. Learn. Res. 20(177), 1–81 (2019) Friedman, J.H.: Greedy function approximation: a gradient boosting machine. Ann. Stat. 1189–1232 (2001) Glymour, C., Zhang, K., Spirtes, P.: Review of causal discovery methods based on graphical models. Front. Genetics (2019). https:// doi. org/ 10. 3389/ fgene. 2019. 00524 Gu, J., Yin, G.: Bayesian knockoff filter using gibbs sampler. ArXiv preprint (2021). https:// doi. org/ 10. 48550/ arXiv. 2102. 05223 Hastie, T., Tibshirani, R., Friedman, J.H., Friedman, J.H.: The Elements of Statistical Learning: Data Mining, Inference, and Prediction, vol. 2. Springer, New York (2009) Hooker, G., Mentch, L., Zhou, S.: Unrestricted permutation forces extrapolation: variable importance requires at least one more model, or there is no free variable importance. Stat. Comput. 31(6), 1–16 (2021). https:// doi. org/ 10. 1007/ s11222- 021- 10057-z Jordon, J., Yoon, J., vander Schaar, M.: Knockoffgan: generating knockoffs for feature selection using generative adversarial networks. In: International Conference on Learning Representations (2019) Kormaksson, M., Kelly, L.J., Zhu, X., Haemmerle, S., Pricop, L., Ohlssen, D.: Sequential knockoffs for continuous and categorical predictors: with application to a large psoriatic arthritis clinical trial pool. Stat. Med. 40(14), 3313–3328 (2021). https:// doi. org/ 10. 1002/ sim. 8955 Krishna, S., Han, T., Gu, A., Pombra, J., Jabbari, S., Wu, S., Lakkaraju, H.: The disagreement problem in explainable machine learning: a practitioner’s perspective. ArXiv preprint (2022). https:// doi. org/ 10. 48550/ arXiv. 2202. 01602 Kursa, M.B., Rudnicki, W.R.: Feature selection with the Boruta package. J. Stat. Softw. 36(11), 1–13 (2010). https:// doi. org/ 10. 18637/ jss. v036. i11 Lei, J., G’Sell, M., Rinaldo, A., Tibshirani, R.J., Wasserman, L.: Distribution-free predictive inference for regression. J. Am. Stat. Assoc. 113(523), 1094–1111 (2018). https:// doi. org/ 10. 1080/ 01621 459. 2017. 13071 16 Linardatos, P., Papastefanopoulos, V., Kotsiantis, S.: Explainable AI: a review of machine learning interpretability methods. Entropy (2021). https:// doi. org/ 10. 3390/ e2301 0018 Liu, Y., Zheng, C.: Auto-encoding knockoff generator for FDR controlled variable selection. ArXiv preprint (2018). https:// doi. org/ 10. 48550/ ARXIV. 1809. 10765 Lundberg, S.M., Lee, S.-I.: A unified approach to interpreting model predictions. Adv. Neural Inf. Process. Syst. 30 (2017) Lundberg, S.M., Erion, G., Chen, H., DeGrave, A., Prutkin, J.M., Nair, B., Katz, R., Himmelfarb, J., Bansal, N., Lee, S.-I.: From local explanations to global understanding with explainable AI for trees. Nat. Mach. Intell. 2(1), 56–67 (2020). https:// doi. org/ 10. 1038/ s42256- 019- 0138-9 Miller, A.M.: Jewelry from antiquity to the modern era. In: Gems and Jewelry Appraising. Springer, Boston (1988). https:// doi. org/ 10. 1007/ 978-1- 4684- 1404-2_5 Molnar, C., König, G., Bischl, B., Casalicchio, G.: Model-agnostic feature importance and effects with dependent features: a conditional subgroup approach. In: Data Mining and Knowledge Discovery, pp. 1–39 (2023). https:// doi. org/ 10. 1007/ s10618- 022- 00901-9 Pearl, J.: Causality. Cambridge University Press, Cambridge (2009). https:// doi. org/ 10. 1017/ CBO97 80511 803161 Ribeiro, M.T., Singh, S., Guestrin, C.: “Why should I trust you?” Explaining the predictions of any classifier. In: Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (2016). https:// doi. org/ 10. 1145/ 29396 72. 29397 78 Ribeiro, M.T., Singh, S., Guestrin, C.: Anchors: high-precision model-agnostic explanations. In: Proceedings of the AAAI Conference on Artificial Intelligence (2018) Rinaldo, A., Wasserman, L., G’Sell, M., Lei, J.: Bootstrapping and sample splitting for high-dimensional, assumption-free inference (2016). https:// doi. org/ 10. 48550/ ARXIV. 1611. 05401 Romano, Y., Sesia, M., Candès, E.: Deep knockoffs. J. Am. Stat. Assoc. 115(532), 1861–1872 (2020). https:// doi. org/ 10. 1080/ 01621 459. 2019. 16601 74 Sesia, M., Sabatti, C., Candes, E.J.: Gene hunting with hidden Markov model knockoffs. Biometrika 106(1), 1–18 (2018). https:// doi. org/ 10. 1093/ biomet/ asy033 Shah, R.D., Peters, J.: The hardness of conditional independence testing and the generalised covariance measure. Ann. Stat. 48(3), 1514–1538 (2020). https:// doi. org/ 10. 1214/ 19- AOS18 57
278 K.Blesch et al. 1 3 Shapley, L.: A value for n-Person games. In: Kuhn, H., Tucker, A. (eds.) Contributions to the Theory of Games II. Princeton University Press, Princeton (1953). https:// doi. org/ 10. 1515/ 97814 00881 970- 018 Shrikumar, A., Greenside, P., Kundaje, A.: Learning important features through propagating activation differences. In: International Conference on Machine Learning. PMLR (2017) Sudarshan, M., Tansey, W., Ranganath, R.: Deep direct likelihood knockoffs. Adv. Neural Inf. Process. Syst. 33 (2020) Tsamardinos, I., Borboudakis, G.: Permutation testing improves Bayesian network learning. In: Machine Learning and Knowledge Discovery in Databases: European Conference, ECML PKDD (2010). https:// doi. org/ 10. 1007/ 978-3- 642- 15939-8_ 21 Vanschoren, J., Van Rijn, J.N., Bischl, B., Torgo, L.: Openml: networked science in machine learning. ACM SIGKDD Explorations Newsl. 15(2), 49–60 (2014) Watson, D.S., Wright, M.N.: Testing conditional independence in supervised learning algorithms. Mach. Learn. 110(8), 2107–2129 (2021). https:// doi. org/ 10. 1007/ s10994- 021- 06030-6 Watson, D.S., Blesch, K., Kapar, J., Wright, M. N.: Adversarial random forests for density estimation and generative modeling. In: Proceedings of the 26th international conference on artificial intelligence and statistics, PMLR 206 (2023) Williamson, B.D., Gilbert, P.B., Carone, M., Simon, N.: Nonparametric variable importance assessment using machine learning techniques. Biometrics 77(1), 9–22 (2021). https:// doi. org/ 10. 1111/ biom. 13392 Xu, L., Skoularidou, M., Cuesta-Infante, A., Veeramachaneni, K.: Modeling tabular data using conditional GAN. Adv. Neural Inf. Process. Syst. 32 (2019) Zou, H., Hastie, T.: Regularization and variable selection via the elastic net. J. R. Stat. Soc. Ser. B (Stat. Methodol.) 67(2), 301–320 (2005). https:// doi. org/ 10. 1111/j. 1467- 9868. 2005. 00503.x Publisher’s Note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. Authors and Affiliations KristinBlesch1,2 · DavidS.Watson3· MarvinN.Wright1,2,4 David S. Watson david.w[email protected] Marvin N. Wright [email protected] 1 Leibniz Institute forPrevention Research & Epidemiology - BIPS, Bremen, Germany 2 Faculty ofMathematics andComputer Science, University ofBremen, Bremen, Germany 3 Department ofInformatics, King’s College London, London, UK 4 Department ofPublic Health, University ofCopenhagen, Copenhagen, Denmark