Consistent Sufficient Explanations and Minimal Local Rules for explaining any classifier or regressor
Abstract
To explain the decision of any regression and classification model, we extend the notion of probabilistic sufficient explanations (P-SE).
For each instance, this approach selects the minimal subset of features that is sufficient to yield the same prediction with high probability, while removing other features.
The crux of PSE is to compute the conditional probability of maintaining the same prediction.
Therefore, we introduce an accurate and fast estimator of this probability via random Forests for any data ( X , Y ) and show its efficiency through a theoretical analysis of its consistency.
As a consequence, we extend the P-SE to regression problems.
In addition, we deal with non-discrete features, without learning the distribution of X nor having the model for making predictions.
Finally, we introduce local rule-based explanations for regression/classification based on the
P-SE
and compare our approaches w.r.t other explainable AI methods.
These methods are available as a Python package 1 .
Introduction
Many methods have been proposed to explain specific predictions of machine learning models from different perspectives, such as feature attributions approaches [Lundberg and Lee, 2017, Ribeiro et al., 2016], decision rules [Ribeiro et al., 2018], counterfactual examples [Wachter et al., 2017] and logic-based [Shih et al., 2018, Darwiche and Hirth, 2020].
Among these categories the most popular are feature attributions approaches in particular SHAP [Lundberg and Lee, 2017] which is based on Shapley Values (SV) and aims at indicating the importance of each feature in the decision.
One of the main reasons for SHAP’s success is its scalability, nice representations of the explanations and mathematical foundations.
However, SV used in SHAP does not guarantee the truthfulness of the important variables involved in a given decision.
Indeed, it is possible to construct simple theoretical models (defined on a partition of the feature space) for which SV cannot distinguish between local important and non-important variables (see conclusion in Amoukou et al.
Similar difficulties have also been highlighted by Ghalebikesabi et al.
[2021] for SHAP and LIME [Ribeiro et al., 2016].
This lack of guarantees is a major issue since the explanations may be used for high-stakes decisions.
Moreover, Additive
Explanations are not suitable when interactions occur in the model [Gosiewska and Biecek, 2019].
An appealing solution to the problem above is to use decision rules [Ribeiro et al., 2018] or logicbased explanations [Darwiche and Hirth, 2020, Shih et al., 2018] which gives local explanations that take into account interactions while ensuring minimality and guarantee on the outcome.
However, these methods are not currently available in the general case (e.g., regression model, continuous features, ...).
Our objective is to extend these methods to more realistic cases by developing new consistent algorithms.
In this paper, we generalize the concept of Probabilistic Sufficient Explanations (P-SE) introduced by Wang et al.
P-SE is a relaxation of logic-based explanation: it explains the classification of an example by choosing a minimal subset of features guaranteeing that, the model makes the same prediction with high probability, whatever the values of the remaining features (under the data distribution).
Such a subset is called a Sufficient Explanation (also known as sufficient reason or prime implicant
[Shih et al., 2018, Darwiche and Hirth, 2020]).
We make several contributions.
We extend the concept of Same Decision Probability (SDP) to the regression setting so that we can extend Sufficient Explanations from classification to regression.
We introduce a fast and efficient estimator of the SDP based on Random Forests and prove its uniform almost sure convergence.
Our approach can deal with non-discrete features and does not need the estimation of the distribution of X , contrary to [Wang et al., 2020].
Our method can explain the data generating process ( X , Y ) directly or any learnt model ( X , f
( X )) .
We introduce the probabilistic local explanatory importance which is the frequency of each feature to be in the set of all Sufficient Explanations.
In particular, this indicates the diversity of the Sufficient
Explanations.
We introduce local rule-based explanations for classification or regression which are simultaneously minimal and sufficient.
We compare our approaches w.r.t other explainable AI methods and provide a Python package that computes all our methods.
Motivations and Related works
The methods used to explain the local behavior of Machine Learning models can be organized into 5 groups: features attributions, decision rules, instance-wise feature selection, logical reasoning approaches, data generation based or counterfactual examples.
The benefits of feature attributionbased explanations, e.g., SHAP [Lundberg et al., 2020] or LIME [Ribeiro et al., 2016] is that they are easy to read, they can be applied to any model and are generally more scalable than their alternatives.
On the other hand, they are sensitive to perturbations [Ignatiev et al., 2019], or can be fooled by adversarial attacks [Slack et al., 2020].
These downsides can be caused by the local perturbations used, which make them inconsistent with the data distribution.
Quite differently, instance-wise feature selection such as L2X [Chen et al., 2018] or INVASE [Yoon et al., 2018] aims at finding the minimal subset of variables that are relevant for a given instance x and its label y .
Interactions can be captured in that way.
In addition, the identification of a minimal subset
S = S ( x ) is well-formalized and the objective is to find S such that L ( Y | X =
x ) ≈ L ( Y | X S = x S ) .
However, these methods are not reliable because they are prone to approximation errors due to the training of several Neural Networks, and they provide no guarantees about the fidelity of the explanations [Jethani et al., 2021].
A similar approach is also developed in [Dhurandhar et al., 2018] called Pertinent Positive.
Anchors [Ribeiro et al., 2018] are local rule-based explanations that propose a solution to the reliability issue by providing an explanation with guarantees.
It explains individual predictions of any classification model by finding a decision rule that reaches a given accuracy for a high percentage of the neighborhood of the instance.
However, the method is only available for classification, requires discrete variables, is unstable and tends to use more variables than needed.
Logical Reasoning Approaches such as Sufficient Reasons [Shih et al., 2018, Darwiche and Hirth, 2020] select a minimal subset of features guaranteeing that, no matter what is observed for the remaining features, the decision will stay the same.
It can be seen as an instance-wise feature selection but with guarantees of sufficiency and minimality (i.e., no subset of the set satisfies the sufficiency condition).
However, since the guarantees are deterministic, it is often necessary to include many features into the explanation, making the explanation more complex and thus less intelligible.
A relaxation of this method is the Sufficient Explanations [Wang et al., 2020] that gives probabilistic guarantees instead of deterministic guarantees, i.e., it required that the prediction remains the same with high probability.
It gives a simple local explanation with guarantees while considering feature interactions and the data distribution.
However, it is limited to classification with binary features and requires learning the distribution of the features.
Moreover, the Sufficient Explanations are not unique, which causes a selection problem as the whole set of explanations is not interpretable.
In this work, we propose a consistent method that efficiently finds the Sufficient Explanations of any data generating process ( X , Y ) or any model ( X , f ( X )) , without learning the distribution of X .
In particular, we don’t need to have access to the model f , we need only the predictions, contrary to [Wang et al., 2020].
We propose local attributions that summarize the diversity of the Sufficient
Explanations.
In addition, we propose local rule-based explanations for regression and classification models based on Sufficient Explanations.
To the best of our knowledge, it is the first local rule-based explanations for regression.
Probabilistic Sufficient Explanations for Regression
Let assume we have an i.i.d sample D n =
( X i , Y i ) i =1 ,...,n such that ( X , Y ) ∼ P ( X ,Y ) where
X ∈ R p and Y ∈ R .
We use uppercase letters for random variables and lowercase letters for their value assignments.
For a given subset S ⊂ [ p ] , X S
=
( X i )
i ∈ S denotes a subgroup of the features.
We define the explanations of an instance x as the minimal subsets x S , S ⊂
[ p ] such that given only those features, the model yields "almost" the same prediction y as on the complete example with high probability, under the data distribution p ( X ) .
The main probabilistic reasoning tool that we use for our explanations is the Same Decision Probability (SDP)
[Chen et al., 2012].
For classification, it is defined as the probability that the classifier has the same output by ignoring some variables.
To explain also regression models, we propose the following definition of the SDP:
Definition 3.1.
(Same Decision Probability of a regressor).
Given an instance ( x , y ) , the Same Decision Probability at level t of the subset S ⊂ (cid:74) 1 , p (cid:75) , w.r.t x = ( x S , x ¯ S ) is
SDP S ( y ; x , t ) = P (cid:0) ( Y − y ) 2 ≤ t | X S
= x S (cid:1) . In a regression setting, the SDP gives the probability to stay close to the same prediction y at level t , when we fix X S = x S or when X ¯ S are missing.
The higher is the probability, the better is the explanation powered by S .
Note that for classification, the SDP is defined as SDP S ( y ; x ) =
P ( Y = y
| X S = x S ) .
Although we present all the methods with the SDP for regression, they remain the same for classification, we only need to replace SDP S
( y ; x , t ) by SDP S ( y ; x ) .
Now, we focus on the minimal subset of features such that the model makes the same or almost the same decision with a given (high) probability π .
Definition 3.2.
( Minimal Sufficient Explanations ).
Given an instance ( x , y ) , S π ( x ) is a Sufficient
Explanation for probability π , if SDP S π ( x ) ( y ; x , t ) ≥ π , and no subset Z of S π ( x ) satisfies
SDP Z ( y ; x , t ) ≥ π .
Hence, a Minimal Sufficient Explanation is a Sufficient Explanation with minimal size.
For a given instance, the Sufficient Explanation or Minimal Sufficient Explanation may not be unique [Darwiche and Hirth, 2020].
Furthermore, there may be significant differences among the
Sufficient Explanations or Minimal Sufficient Explanations.
We denote A-SE as the set of all
Sufficient Explanations and M-SE as the set of Minimal Sufficient Explanations.
Thus, the number and the diversity of the explanations make the method less intelligible, as deriving one of them is not informative enough, and all of them are too complex to interpret.
Therefore, we propose to compute the following local attributions that summarize the importance of each variable in A-SE/M-SE:
Definition 3.3.
( Local eXplanatory Importance - LXI ).
Given an instance ( x , y ) and its A-SE or
M-SE.
The local explanatory importance of x i is how frequent x i is chosen in the A-SE or M-SE.
Contrary to classical local feature attributions like SHAP or LIME, the values of Local Explanatory
Importance does not depend on the range of values of the predictions, and are interpretable by design.
It corresponds to the frequency of apparition in the A-SE or M-SE, which allows to reason about the relative difference between the attribution of each feature.
Indeed, we can easily discriminate between the importance of variables in terms of probabilities compared to arbitrary values of SHAP or LIME that depend on the model and its predictions.
In our framework, a value equal to 1 means that this feature is present in all the A-SE/M-SE.
Hence this feature is necessary to maintain the prediction.
Moreover, the attributions of the features are sparse since they are based on the A-SE/M-SE.
Although Sufficient Explanations allow finding local relevant variables, we may want to know the logical reasons relating input and output.
In essence, explaining a decision means giving the reasons that highlight why the decision has been made.
Therefore, we propose to extend the Sufficient Explanations into local rules.
A rule is a simple IF-THEN statement, e.g., IF the conditions on the features are met, THEN make a specific prediction.
Recall that given an instance x , a Sufficient Explanation is the minimal subset S ⊂
[ p ] , such that fixing the values X S
= x S permits to maintain the prediction with high probability.
The idea is to find the largest rectangle
L S ( x ) = (cid:81) | S | i =
[ a i , b i ] , a i , b i ∈ R given the indexes of the Sufficient Explanation S such that x S ∈ L S ( x ) and ∀ z with z S ∈ L S ( x ) , SDP S ( y ; z ; t ) ≥ π .
Definition 3.4.
( Minimal Sufficient Rule ).
Given an instance ( x , y ) , S a Minimal Sufficient
Explanation, the rectangle L S ( x ) =
(cid:81) | S | i =
[ a i , b i ] , a i , b i ∈ R is a Minimal Sufficient Rule if L S ( x ) =
argmax L ( x ) V ol ( L ( x )) , x S ∈ L S ( x ) and ∀ z , z S ∈ L S ( x ) , SDP S ( y ; z , t ) ≥ π .
Intuitively, the Sufficient Rule is a generalization of the Sufficient Explanation, i.e., instead of satisfying the minimality/sufficiency conditions of definition 3.2 if we fixed the values X S = x S , we want to satisfy these conditions on all the elements of a rectangle L S ( x ) that contains x S .
We also want this rectangle to be of maximal volume such that it covers a large part of the input space.
Thus, the Sufficient Rule captures the local behavior of the model around x while ensuring the minimality of the rule and guarantees on the outcome.
Note that the volume of the rectangle L can be defined as
V ol ( L ( x )) =
P ( X ∈ L ( x )) or λ ( L ( x )) , with λ the Lebesgue measure.
While Sufficient Rules are similar to Anchors introduced by Ribeiro et al.
[2018], we emphasize two major types of differences.
The first is that our framework for constructing rules can address regression problems, deal with continuous features without discretization, and do not need access to the model f .
Moreover, if we have a model f and an instance x , Anchors search the largest rule (or rectangle) L S ( x ) such that P Q ( f ( x ) =
Y | X S ∈ L S ( x )) ≥ π under an instrumental distribution Q .
This is different from the Sufficient Rule that requires the stability of the prediction for all the observations in the rectangle i.e ∀ x S ∈ L S ( x ) , P ( f ( x ) =
Y | X S
= x S ) ≥ π .
The second major difference is that the Sufficient Rule is based on the original distribution P ( X ,Y ) as we use conditional distribution P ( Y | X S ) .
At the contrary, anchors use local sampling perturbations (introducing another distribution Q ).
As we discuss in the next section, the effective computation of these rules is very different.
Anchors use a heuristic approach to find the minimal rule, which might produce suboptimal minimal rules.
The Sufficient Rules satisfy a minimality principle by definition.
SDP, Sufficient Explanations and Sufficient Rules via Random Forest
In order to find the Sufficient Explanations S π ( x ) and the corresponding Sufficient Rules L S π ( x ) , we need to compute the SDP for any subset S .
However, the computation of the SDP is known to be computationally hard; even for simple Naive Bayes model, the computation of SDP is NP-hard [Chen et al., 2013].
Consequently, approximate criteria based on expectations instead of probabilities have been introduced by Wang et al.
They proposed to use a Probabilistic Circuit [Choi et al., 2020] to model the distribution of the features X and compute a lower bound of the SDP.
In this section, we propose a consistent estimator of the SDP for any distribution ( X , Y ) .
It is based on two ideas: Projected Forest [Bénard et al., 2021a,c] and Quantile Regression Forest [Meinshausen and Ridgeway, 2006].
The Projected Forest is an adaptation of the Random Forest algorithm that estimates E [ Y | X S = x S ] instead of E
[ Y | X
= x ] , and the Quantile Regression Forest uses the
Random Forest algorithm to estimate the Conditional Distribution Function (CDF)
P ( Y ≤ y | X = x ) .
The first step is to write the SDP as
[Equation]
Equation 4.1 shows that the only challenge is to estimate the Projected (or Conditional) CDF
F S ( y | X S = x S ) =
P ( Y ≤ y | X S
= x S ) .
The variant of the original Random Forest proposed by Meinshausen and Ridgeway [2006] that estimates the CDF F ( y | X = x ) =
P ( Y ≤ y | X = x ) is not of interest to us because we want to estimate the Projected CDF F S ( y | X S
= x S ) for any
S .
The recent works by Bénard et al.
[2021a,c] are much more relevant as they permit to estimate
E [ Y | X S = x S ] from a classical Random Forest that has learned to predict E [ Y | X = x ] .
The idea is to extract a new Forest called Projected Forest from the original Forest, which is a projection of the original Forest along the S -direction.
We propose to combine the ideas of Quantile Regression Forest and Projected Forest to estimate the Projected CDF F S ( y | X S = x S ) .
In addition, we prove the consistency of our estimator of the
Projected CDF.
4.1 Random Forest and Condition Distribution Function (CDF) Forest
A Random Forest (RF) is grown as an ensemble of k trees, based on random node and split point selection based on the CART algorithm
[Breiman et al., 1984].
The algorithm works as follows.
For each tree, a n data points are drawn at random with replacement from the original data set of size n ; then, at each cell of every tree, a split is chosen by maximizing the CART-criterion; finally, the construction of every tree is stopped when the total number of cells in the tree reaches the value t n .
For each new instance x , the prediction of the l -th tree is:
[Equation]
where:
Θ l , l = 1 , . . .
, k are independent random vectors, distributed as a generic random
vector Θ =
(Θ 1 , Θ 2 ) and independent of D n
Θ 1 contains indexes of observations that are
used to build the tree,
i
e. the bootstrap sample and Θ 2 indexes of splitting candidate variables in each node.
Θ 1: k denotes the sequence of Θ l ’s. • A n ( x ; Θ l , D n ) is the tree cell (leaf) containing x • N n ( x ; Θ l , D n ) is the number of bootstrap elements that fall into A n ( x ; Θ l , D n ) • B n ( X i ; Θ l ) is the bootstrap component
i e. the number of times that the observation has been chosen from the original data.
The trees are then averaged to gives the prediction of the forest as:
[Equation]
The Random Forest estimator (Eq. 4.2) can also be seen as an adaptive neighborhood procedure [Lin and Jeon, 2006].
For every instance x , the observations in D n are weighted by w n,i ( x ; Θ 1: k , D n ) , i = 1 , . . . , n .
Therefore, the prediction of Random Forests and the weights can be rewritten as m k,n ( x , Θ 1: k , D n ) = n [Equation] i
[Equation]
x ; Θ
[Equation] n [Equation] Viewing a Random Forest as an adaptive nearest neighbor predictor offers natural estimates of more complex quantities (Cumulative hazard function [Ishwaran et al., 2008], Treatment effect [Wager and Athey, 2017], and conditional density [Du et al., 2021]).
Therefore, just as E [ Y | X = x ] is approximated by a weighted mean over observation of Y i , E [ 1 Y ≤ y | X
= x ] is approximated by the weighted mean over the observations of 1 Y i ≤ y using the same weights w n,i ( x ; Θ 1: k , D n ) .
The approximation is
[Equation]
To simplify notations, we omit Θ 1 , . . .
, Θ k , D n and we write (cid:98) F S ( y | X S
= x S ) for any S .
4.2 Projected Forest and Projected CDF Forest
We describe the Projected Forest (PRF) and show how it is combined with the Quantile Regression
Forest to build the estimator of the Projected CDF.
The PRF algorithm has been introduced in Bénard et al.
[2021c,a].
The idea is to project the partition of each tree of the forest on the subspace spanned by the variables in S , thus we can estimate E
[ Y | X S ] rather than E
[ Y | X ] .
The computation of these partitions for each S can be computationally expensive in high dimension.
However, Bénard et al. [2021a] uses a simple algorithm trick to derive efficiently the output of the Projected Forest without computing explicitly its partitions.
Roughly, for computing the prediction of a tree, the algorithm ignores the splits that use variables not contained in S .
It works as follow: when an observation is dropped down in the initial trees, and it encounters a split involving a variable i / ∈ S , the observation is sent both to the left and right children nodes.
As a result, each observation falls in multiple terminal leaves of the tree.
Thus, to compute the prediction of an instance x S , we collect the set of terminal leaves where it falls, and average the output Y i of the training observations which belong to every terminal leaf of this collection.
E [ Y | X S
= x S ] is estimated as the average outputs of the training observations in the intersection of the leaves where x S falls.
An efficient implementation of the PRF algorithm is detailed in Appendix.
The associated PRF is m ( x S ) k,n ( x S )
= (cid:80) ni
=1 w n,i ( x S ) Y i where the weights are defined by
[Equation]
where A ( x S ) n ( x S ; Θ l , D n ) is the leaf of the associated Projected l -th tree where x S falls and
N ( x S ) n ( x ; Θ l , D n ) is the number of bootstrap observations that falls in A ( x S ) n ( x S ; Θ l , D n ) .
Therefore, we approximate the Projected CDF F S ( y | X S
= x S ) =
P ( Y ≤ y | X S
= x S ) as in Eq.
4.3 by using the weights of the Projected Forest defined in Eq.
The estimator of the Projected CDF is defined as: (cid:98) F S ( y | X S
= x S )
=
(cid:80) ni
=1 w n,i ( x S )
1 Y i ≤ y .
4.3 Consistency of the Projected CDF Forest
In this section, we state our main result, which is the uniform a.s. convergence of the estimator (cid:98) F S ( y | X S = x S ) to F S ( y | X S
= x S ) .
Meinshausen and Ridgeway [2006] showed the uniform convergence in probability of a simplified version of the estimator of the CDF defined in Eq.
4.3, where the weights w n,i ( x S ; Θ 1: k , D n ) are in fact considered to be non-random while they are indeed random variables depending on (Θ l ) l =1 ,...,k , D n .
Moreover, the bootstrap was replaced by subsampling without replacement as in most studies that analyse the asymptotic properties of Random
Forests [Scornet et al., 2015, Wager and Athey, 2017, Goehry, 2020].
However, Elie-Dit-Cosaque
and
Maume-Deschamps [2020] showed the almost everywhere uniform convergence of both estimators (the simplified and the one defined in Eq. 4.3) under realistic assumptions with all the randomness and bootstrap samples.
We follow their works to prove the consistency of the PRF CDF (cid:98) F S ( y | X S = x S ) based on the following assumptions.
Assumption 4.1.
∀ x ∈ R d , the conditional cumulative distribution function F ( y | X = x ) is continuous.
Assumption 4.1 is necessary to get uniform convergence of the estimator.
Assumption 4.2.
For l ∈ [ k ] , we assume that the variation of the conditional cumulative distribution function within any cell goes to 0 .
[Equation]
Assumption 4.2 allows to control the approximation error of the estimator.
If for all y , F ( y | . ) is continuous, Assumption 4.2 is satisfied provided that the diameter of the cell goes to zero.
Note that the vanishing of the diameter of the cell is a necessary condition to prove the consistency of general partitioning estimator (see chapter 4 in Györfi et al.
Scornet et al.
[2015] show that it is true in RF where the bootstrap step is replaced by subsampling without replacement and the data come from additive regression models [Stone, 1985].
The result is also valid for all regression functions, with a slightly modified version of RF, where there are at least a fraction γ observations in children nodes, and the number of splitting candidate variables is set to 1 at each node with a small probability.
Under these small modifications, Lemma 2 from Meinshausen and Ridgeway [2006] gives that the diameter of each cell vanishes.
Assumption 4.3.
Let k and N n ( x ; Θ l , D n ) (number of bootstrap observations in a leaf node), then there exists k
= O ( n α ) , with α > 0 , and ∀ x ∈ R d , N n ( x ; Θ l , D n ) =
Ω 2 ( √ n ( ln ( n )) β ) , with β >a.s.
Assumption 4.3 allows us to control the estimation error and means that the cells should contain a sufficiently large number of points so that averaging among the observations is effective.
To prove the consistency of the PRF CDF (cid:98) F S ( y | X S = x S ) , we only need to verify the assumptions 4.1, 4.2, 4.3 on the parameters of the PRF CDF and the Projected CDF F S ( y | X S = x S )
= P ( Y ≤ y | X S = x S ) .
Assumptions 4.1 and 4.2 are satisfied for the Projected CDF and the PRF CDF’s leaves.
Since by definition A ( x S ) n ( x S ; Θ l , D n ) ⊂
A n ( x ; Θ l , D n ) , if the variations within the cells of the RF
[Equation]
vanish (diameter goes to zero), it also vanishes in the Projected forest.
In addition, if the CDF
F ( y | X = x ) =
F ( y | X S
= x S , X ¯ S
= x ¯ S ) is continuous, we can show by a straightforward analysis of parameter-dependent integral that the Projected CDF F S ( y | X S = x S ) = (cid:82) F ( y | X S = x S , X ¯ S
= x ¯ S ) p ( x ¯ S | x S )
d x ¯ S is also continuous.
As we control the minimal number of observations in the leaf of the PRF CDF by construction, Assumption 4.3 is also verified.
Then, the PRF CDF satisfies also Assumption 4.1-4.3 which ensures its consistency thanks to Theorem 4.4.
Theorem 4.4.
Consider a RF satisfying Assumptions 4.1 to 4.3.
Then,
[Equation]
The complete proof and simulations showing the convergence of the estimator can be found in
Appendix.
4.4 Estimation of SDP, Sufficient Explanations and Sufficient Rules
In this section, we show how we compute the SDP, Sufficient Explanations, and Sufficient Rules using the PRF CDF estimator.
We derive from the previous section the following consistent estimator of any SDP S ( y ; x , t ) :
[Equation]
However, finding the A-SE/M-SE using a greedy algorithm is computationally hard, since the number of subsets is exponential.
Therefore, we propose to reduce the number of variables by focusing only on the most influential variables.
We search the Sufficient Explanations in the subspace of the s =variables frequently selected in the RF used to estimate the SDP, reducing the complexity from 2 p to 2 10 .
This preselection procedure is already used in Bénard et al.
[2021b,a], and it is mainly based on Proposition 1 of Scornet et al.
[2015], which highlights the fact that RF naturally splits the most on influential variables.
Note that the minimum number of selected variables s is a hyperparameter.
To find the Sufficient Rules, we used the SDP’s estimator (cid:91) SDP S .
By using the fact that the PRF CDF is a tree-based model, and thus (cid:91) SDP S partitions the space like a tree or a Random Forest, we do not need to discretize the continuous space to find the largest rectangle.
We only need to find the leaves compatible with the conditions of the Sufficient Rule defined in 3.4.
Given a
Minimal Sufficient Explanation S of an instance x , we already a have a rectangle L S ( x ) defined by the PRF CDF or (cid:91) SDP S that is the largest rectangle such that x S ∈ L S ( x ) and ∀ z with z S ∈
L S ( x ) , (cid:91) SDP S ( y ; z , t ) = (cid:91) SDP S ( y ; x , t ) ≥ π .
By definition, it is the intersection of the cell of the trees where x S falls, namely ∩ kl =1 A ( x S ) n ( x S ; Θ l , D n ) .
Thus, starting from ∩ kl =1 A ( x S ) n ( x S ; Θ l , D n ) , which is also a cell (leaf) of the Projected Forest, we can find all the neighboring leaf (rectangle) that we can merge with it to get the largest rectangle.
We will see in the next section that it provides good insights about the local behaviour of the model.
How to choose the hyperparameters.
The main hyperparameters are: s the number of preselected variables, π the minimal probability of changing the decision and t which corresponds to the radius of the ball center at the prediction in the definition 3.1 of the SDP for regression problems.
The choice of s ≪ p is motivated by the fact that many datasets have intrinsic dimensions much lower than the ambient dimension.
Our Selection criterion is based on Proposition 1 in [Scornet et al., 2015], which highlights the fact that RF naturally splits the most on influential variables, but any RF’s importance measure s.t. Mean Decrease Accuracy [Breiman, 2001] or Impurity [Breiman and Cutler, 2003] can be used as the RF algorithm is known to adapt to the intrinsic dimension [Scornet et al., 2015, Klusowski, 2020].
Therefore, the choice of s is directly driven by the computation power available to explore the subsets.
In practice, we have always found coalitions S with a probability above π = 0 .
9 with s = 10 for real world datasets.
Otherwise, we propose a trade-off between the maximal reachable size s and the highest probability.
We suggest choosing π = 0 .
9 as it is an acceptable level of risk, but the user can increase/decrease this probability depending on the use case.
Probably the newest and most challenging hyperparameter to select is t ; we suggest having an adaptive radius t ( x ) using the quantile of the conditional distributions Y | X = x , which is a by-product of the Quantile Regression Forest used for computing the SDP.
For each observation, we choose the radius t ( x ) =
[ˆ q α 1 ( x ) , ˆ q 1 − α 2 ( x )] with α 1 + α 2 = α .
We build then a confidence interval of varying length but with constant confidence level across the dataset.
This makes our approach as a natural generalization of the SDP in the classification case by accounting for the uncertainty of the model to explain.
In that case, the SDP and associated sufficient coalition should be read: "if X S =
x S is fixed, then there is a probability at least π of not changing the prediction significantly with level 1 − α , or Y ∈
[ˆ q α 1 ( x ) , ˆ q 1 − α 2 ( x )] with probability π .
{+For this reason, we suggest fixing α 1 + α 
+}
= α and π at standard level 1 − α =
π = 0 .
9 agreeing with acceptable level of risks.
We conduct three experiments in this section.
The first compares the Sufficient Explanations, Sufficient Rules and LXI with state-of-art (SOTA) local explanations methods (SHAP, LIME, INVASE) in a simple high dimensional regression model with small relevant features.
Although this model is simple, SOTA (SHAP, LIME) have been shown to poorly detect the important variables of this model [Amoukou et al., 2021, Ghalebikesabi et al., 2021].
Then, we analyse the performance of the Sufficient Rules in a real world regression problem.
Finally, we highlight the advantages of the Sufficient Rules in comparison with Anchors in real world classification datasets.
More experiments can be found in Appendix.
To effectively compare different explanation methods, we use synthetic data since we need the ground truth.
We use the following synthetic model: we have X ∈ R p , X ∈ N (0 , Σ) , Σ = 0 .
8 J p +
I p with p = 100 , I p is the identity matrix, J p is all-ones matrix and a linear predictor with switch defined as:
[Equation]
The variables X i for i = 6 . . .
100 are noise variables.
We fit a RF with a sample size n = 10 4 , k = 20 trees and the minimal number of samples by leaf node is set to t n = ⌊√ n × ln( n ) 1 . 5 / 250 ⌋ for the original and the Projected Forest.
The R 2 = 99% on the test set of size 10 4 .
The RF is used to compute the explanations of SHAP, LIME.
The Projected Forest is also extract from the RF for the SDP approaches.
We choose α 1 = 0 .
05 , α 2 = 0 . 95 and π = 0 .
For INVASE, we use Neural Networks with 3 hidden layers for the selector model and the predictor model as in Yoon et al.
Notice that for SHAP, LIME and the SDP approaches, we used the same information (the learned RF) to retrieve the true explanation of the data.
The performance of INVASE and the RF is the same, both model perfectly fit the data with a R 2 = 99% .
SDP approaches vs SOTA (SHAP, LIME, INVASE) on regression.
Here, we analyze the capacity of each method to discover the local important variables of the model defined in Eq. 5.1.
Indeed, Eq.
5.1 shows that if x 5 ≤ 0 , the model uses only the variables x 1 , x 2 otherwise it uses the variables x 3 , x 4 .
Thus, we try to find the top K = 3 relevant features for each sample.
Note that K is not a required input for SDP and INVASE, but K must be given for SHAP and LIME.
We use the true positive rate (TPR) (higher is better) and false discovery rate (FDR) (lower is better) to measure the performance of the methods on discovery (i.e., discovering which features are relevant).
In addition, as one of the objectives of each method is to find the minimal subset x S that is relevant to the corresponding target y , we also compute a predictive performance metrics that shows how well the projected predictor E [ Y | X S = x S ] selected by each method is close to the predictor on the full set of features E [ Y | X = x ] , under the data distribution.
Formally, for a given subset S , we denote it as P-MSE =
E Z (cid:20)(cid:16) E
[ Y | X
= Z ] − E
[ Y | X S
= Z S ] (cid:17) 2 (cid:21) where Z ∼ P X .
We obtain the following results for Sufficient Explanation (TPR = 99% , FDR = 2% , P-MSE = 0 . 02 ),
INVASE (TPR = 99% , FDR = 87% , P-MSE = 0 . 006 ), SHAP (TPR = 73% , FDR = 27% , PMSE = 0 . 79 ), and LIME (TPR = 50% , FDR = 49% , P-MSE = 5 . 01 ).
We observe that the Sufficient
Explanations succeeds to find the top K relevant variables and outperform the other methods by a significant margin.
SHAP and LIME obtain the worst discovery rate.
INVASE succeeds in finding the relevant variables, but it has a high FDR ( 87% ), which means we cannot distinguish between the relevant and irrelevant variables since 87% of the selected variables are irrelevant.
We also see that the P-MSE of INVASE is the lowest, which is not surprising as it selects all the relevant variables despite its high FDR.
Indeed, this metric is not much affected by the FDR.
The P-MSE of Sufficient
Explanations is also almost zero, and as above, SHAP and LIME perform worse than the other methods.
In table 1, we compare the LXI and SHAP values on 1000 observations having X 5 > 0 .
We compare the mean absolute values of SHAP and average LXI on this sub-population. Notice that on this model, these observations have a single Sufficient Explanation which is the variables X 3 , X 4 , X 5 . Both models give null attributions to the noise variables, but SHAP gives higher importance to the variables X 1 , X 2 than the truly important variables X 3 , X 4 , X 5 . On the other hand, LXI gives non null attributions only on the important variables.
We refer to the Appendix for an additional comparison with SHAP in a case where there are several Sufficient Explanations. [Table]
However, even if the Sufficient Explanation find effectively the top K relevant variables, it cannot provide a complete understanding of the local behavior of the regression model (the baseline methods also), i.e., that it’s the sign of x 5 that matters.
Thus, by extending the Sufficient Explanation into Sufficient Rule we can retrieve the complete story.
We choose an observation ( x , y ) such that its Sufficient Explanation found is S
= [ X 3 , X 4 , X 5 ] , with x S =
[ − 3 .
64 , − 4 .
Although the Sufficient Explanation shows that fixing the value x S permit to maintain the prediction with high probability, the Sufficient Rule gives the additional information that we can also maintain the prediction within a small radius around y by satisfying the rule L S ( x ) = {
X 5 > 0 AND − 4 , 45 ≤ X 4 ≤ − 4 , 06 AND − 3 .
67 ≤ X 3 ≤ − 3 . 58 } .
The Sufficient Rule L S ( x ) catches perfectly the local behaviour of the model which says that despite the values of x 3 , x 4 , it’s the sign of x 5 that matters. SDP approaches on real world regression.
We demonstrate the performance and flexibility of the
Sufficient Rules (SR) on a real world regression dataset. Since there are no ground truth explanations for real world datasets, we use the predictive performance and simplicity (number of variables used) of the SR as an indicator of the effectiveness of the explanations. Indeed, we can build a global model by combining all the Sufficient Rules found for the observations in the training set, and we measure its performance on the test set. We set the output of each rule as the majority class (resp.
average values) for classification (resp.
regression) of the training observations that satisfy this rule.
Note that some rules can overlap and an observation can satisfy multiple rules.
To resolve these conflicts, we use the output of the rule with the best precision (AUC or MSE).
We called this model
Global-SR.
We have experimented on Bike Sharing data [Kaggle, 2015] that contains 10886 records and 15 variables about historical usage patterns with weather data in order to forecast bike rental demand in the Capital Bikeshare program in Washington, D.C.
We split the data into train ( 75% ) - test ( 25% ) set and train a RF with k = 20 trees and maximal depth = 14 .
It has R 2 = 94% on test set.
We use the RF on the train set to generate the SR.
Although the Global-SR covers 78% of the test set, we observe that it performs as well as the baseline models with R 2 = 90% while being transparent in its decision process.
Note that the rules of the SR on Bike
Sharing Demand are based on 4.5 variables in average.
{+We give examples of the learned rules: R 
+}
= {
If Workingday =
True and Hours ∈ [6.5, 7.5]
THEN Bike rental demand = 20 } ,
R= { If Hours ∈ [8.5, 9] and Year ≤ 2011 and month ≥ 5 THEN Bike rental demand = 192 } .
The number of observations that satisfy these rules is 145 , 133 for the rules R 1 ,
R 2 respectively with a mean absolute error MAE R 1 = 17 , MAE R 2 = 36 .
Anchors vs Sufficient Rules (SR).
To compare our methods w.r.t to Anchors, we have to consider a classification problem.
We use three popular real-world datasets: Compas ( n = 6167 , p = 14)
[Larson et al., 2016], Nhanesi ( n = 8593 , p = 17) [CDC, 1999-2022], and Employee Attrition ( n = 1470 , p = 27)
[Kaggle, 2017] which we split into train ( 75% ) - test ( 25% ) set, and train a
RF with the parameters of the previous section.
We use the RF to generate the local rule-based explanations with Anchors and the SDP approach (Sufficient Rules) to explain the RF’s predictions on the test set.
We aim to evaluate the generalization of each explanation across the population, thus we measure the average of this metrics Coverage (higher is better): what fraction of unseen instances fall in the rule and Correctness (higher is better): average number of unseen instances that satisfy the rule and has the same output than the observation that generate the rule, Sparsity (lower is better): the mean, variance and maximal size of the rule (number of variable on which it is based).
[Table]
In table 2, we observe that both model have a high accuracy in all datasets, but SR consistently outperforms Anchors on all datasets in Correctness and Coverage .
On the other hand, Anchors uses many more features.
Indeed, by sampling marginally (i.e. assuming that the features are independent)
Anchors can succeed to find accurate and high coverage rule, but at the cost of optimality.
In fact, we can observe in table 2 that Anchors tend to give much longer rules.
While the observed maximal size of SR is 9 in all dataset, Anchors can provide a rule of size 12 ( Compas ), 16 ( Nhanesi ), 23 ( Attrition ).
For instance, the size distribution of Anchors on
Nhanesi is represented with the following dictionary { size : count } : { 1 : 704 , 2 : 127 , 3 : 71 , 4 : 21 , 5 : 13 , 6 : 10 , 7 : 10 , 8 : 9 , 9 : 9 , 10 : 4 , 11 : 2 , 12 : 4 , 13 : 5 , 14 : 1 , 16 : 1 } , and the corresponding distribution for the SR is { 1 : 775 , 2 : 145 , 3 : 52 , 4 : 9 , 5 : 12 , 7 : 4 } .
Note that this is a significant drawback of Anchors, as simplicity of the explanations is an essential desideratum for explanation methods.
We give an additional experiment confirming these results in the Appendix.
Another desirable property of explanation methods is stability, i.e nearby observations must have same explanations.
Here, we evaluate the stability of the methods w.r.t input perturbations.
For each observation x , we compare its rule with the rules of 50 noisy versions of x obtained by adding random Gaussian noises N (0 , ϵ × I ) to the features values with ϵ = 0 .
The perturbation is small enough to not change the prediction.
For each dataset Compas, Nhanesi, Attrition , we randomly perturb 100 observations in the test set with 50 noisy versions, and we observe in average 10 (std=76), 6.83 (std=139), 14 (std=58) different rules for Anchors respectively, while we have 1.5 (std=0.25), 1.1 (std=1.9), 1.13 (0.13) for SR, resp.
It shows the large instability of Anchor compared to SR.
Indeed, even when ϵ = [-
-]0 (no perturbation), Anchors gives different rules, e.g., on Compas its has(std=70) different rules in average with no perturbations.
Results for other values of ϵ can be found in Appendix.
These experiments demonstrate that the SR gives more optimal rules than the one returned by Anchors.
We also conduct an additional experiment in the Appendix that confirms this claim in a setting where we know exactly the ground truth.
Conclusion
In this work, we introduce a fast and consistent estimator of the Same Decision Probability and propose a natural generalization of the SDP for regression problems.
Thus, we introduce the first local rule-based explanations for regression. We give a consistent estimates of three local explanations methods: Minimal Sufficient Explanations, Local eXplanatory Importance, and Minimal Sufficient
Rules for any data. We prove that these methods considerably improve local variable detection over state-of-the-art algorithms while ensuring minimality, sufficiency, and stability.
Our generalization of SDP and Minimal Sufficient Rules are tightly related.
They are linked by a Random Forest, which is a computationally and statistically efficient estimator of the SDP and gives the partition that is translated into an interpretable rule.
Therefore, our method is principally suitable for datasets where tree-based models work (e.g., tabular data).
In future works, we aim at improving the interpretability and confidence of the Sufficient Rules by taking into account uncertainty estimates of their predictions.
Acknowledgments
This work has been done in collaboration between Stellantis and Laboratoire de Mathématiques et
Modélisation d’Évry
(LaMME) and was supported by the program Convention Industrielle de Formation par la Recherche (CIFRE) of the Association Nationale de la Recherche et de la Technologie (ANRT).
Checklist
For all authors... (a) Do the main
claims made in the abstract and introduction accurately reflect the paper’s contributions and scope?
Yes ] We present the Minimal Sufficient Explanations, the Local eXplanatory Importance (LXI), and the Sufficient Rules in Section 3.
While the Sufficient Rules and LXI are new, the Sufficient Explanations are a generalization of existing works so that they can also address regression problems, deal with continuous features, and are more efficient to estimate.
We present all the theoretical framework in Section 4 and their complete proofs in Appendix.
We provide a Python package that computes our methods.
Finally, we demonstrate the advantage of our methods w.r.t SOTA on real-world datasets in section 6.
(b) Did you describe the limitations of your work?
[Yes] Yes, we remind in the conclusion that our approaches are appropriate for datasets where tree-based models work.
(c) Did you discuss any potential negative societal impacts of your work?
[Yes] Our work is fully dedicated to the positive societal impacts.
Indeed, we propose new methods that outperforms SOTA in local important feature detection.
In addition, we propose a new rule-based explanation that is more faithful to the data distribution than prior works (Anchors).
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them?
[Yes] We conform to the ethics review.
If you are including theoretical results... (a) Did you state the full set of assumptions of all theoretical results?
[Yes] We state all the theoretical results in Section 4.
(b) Did you include complete proofs of all theoretical results?
[Yes] The complete proofs are in Appendix.
If you ran experiments... (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)?
[Yes] We provide a Python package and the results at https://github.com/salimamoukou/acv00 .
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)?
[Yes] See Appendix.
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)?
[Yes] (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)?
[Yes] See Appendix. 4.
If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... (a) If your work uses existing assets, did you cite the creators?
[Yes] We cited the datasets that we used.
(b) Did you mention the license of the assets?
[Yes] (c) Did you include any new assets either in the supplemental material or as a URL?
[Yes] It can be found at https://github.com/salimamoukou/acv00 .
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating?
[No] Not relevant (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content?
[No] Not relevant 5.
If you used crowdsourcing or conducted research with human subjects... (a) Did you include the full text of instructions given to participants and screenshots, if applicable?
[No] Not Relevant (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable?
[No] Not relevant (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation?
[No] Not Relevant