Finding Influential Training Samples for Gradient Boosted Decision Trees

Boris Sharchilev, Yury Ustinovsky, Pavel Serdyukov, Maarten de Rijke

Introduction and Background

As machine learning-based models become more widespread and grow in both scale and complexity, methods of interpreting their predictions are increasingly attracting attention from the machine learning community. Some of the applications and benefits of employing these methods outlined in previous work (Ancona et al., 2017) include (1) “debugging” the model to expose ways of model failures not discoverable via conventional test set performance measuring (e.g., data or target leakages); (2) boosting developer’s trust in the model’s performance in scenarios when on-line evaluation is not available before deployment; and (3) increasing user satisfaction and/or confidence in provided predictions, etc . Various problem setups (Palczewska et al., 2013; Tolomei et al., 2017; Fong & Vedaldi, 2017) and interpretation methods, both model-agnostic (Ribeiro et al., 2016; Lundberg & Lee, 2017) and model-specific (Shrikumar et al., 2017; Tolomei et al., 2017; Sundararajan et al., 2017), have recently been proposed in the literature.

A common trait shared by the majority of these methods is that they treat the provided model as a fixed function of input objects and study which features had the largest effect on the prediction, how the model responds to feature perturbations, etc. However useful they are, the obtained interpretations do not provide a way of automatically improving the model, since the model is fixed; the main use-case thus becomes manual analytics by the user or the developer, which is both time and resource-consuming. It is thus desirable to derive a framework for obtaining actionable insights into the model’s behavior allowing us to automatically improve a model’s performance.

One such framework has recently been introduced by Koh & Liang (2017); it deals with finding the most influential training objects. They formalize the notion of “influence” via an infinitesimal approximation to leave-one-out retraining: the core question that this work aims to answer is “how would the model’s performance on a test object xtest\mathbf{x}_{test} change if the weight of a training object xtrain\mathbf{x}_{train} is perturbed?” Assuming a smooth parametric model family (e.g., linear models or neural networks), the authors employ the Influence Functions framework from classical statistics (Cook & Weisberg, 1980) to show that this quantity can be estimated much faster than via straightforward model retraining, which makes their method tractable in a real-world scenario. A natural use-case of such a framework is to consider individual test objects (or groups of them) on which the model performs poorly and either remove the most “harmful” training objects or prioritize a batch of new objects for labeling based on which ones are expected to be the most “helpful,” akin to active learning.

Unfortunately, the method suggested by Koh & Liang (2017) heavily relies on the smooth parametric nature of the model family. While this is a large class of machine learning models, it is by far not the only one. In particular, decision tree ensembles such as Random Forests (Ho, 1995, RF) and Gradient Boosted Decision Trees (Friedman, 2001, GBDT) are probably the most widely used model family in industry, largely due to their state-of-the-art performance on structured and/or multimodal data. Thus, it is important to extend the aforementioned Influence Functions framework to tree ensembles.

In this paper, we propose a way of doing so, while focusing specifically on GBDT. We consider two proxy metrics for the informal notion of influence. For the first one, leave-one-out retraining, we utilize the inner mechanics of fitting decision trees (in particular, assuming that a small training sample perturbation does not change the trees’ structures) to derive LeafRefit and FastLeafRefit, a well-founded family of approximations to leave-one-out retraining that trade off approximation accuracy for computational complexity. For the second, analogously to the Influence Functions framework, we consider infinitesimal training sample weight perturbations and derive LeafInfluence and FastLeafInfluence, methods for estimating gradients of the model’s predictions with respect to training objects’ weights. From a theoretical perspective, LeafInfluence and FastLeafInfluence allow us to deal with the discontinuous dependency of tree structure on training sample perturbations; from a practical one, they allow us to further reduce computational complexity due to the possibility of precomputing certain derivatives.

In our experiments we (1) study the conditions under which our methods, FastLeafRefit and FastLeafInfluence, successfully approximate their proxy metrics, (2) demonstrate our methods’ ability to target training objects which are influential for specific test objects, and (3) show that our algorithms run much faster than straightforward retraining, which makes them applicable in practical scenarios.

Problem Definition

First, we formally define the problem setup. We consider standard supervised training of a GBDT ensembleMathematical notations are defined in Table 1. F(x;w):=∑t=1TfP(x)tt(At−1)F(x;\mathbf{w}):=\sum_{t=1}^{T}f_{P(x)_{t}}^{t}(\mathbf{A^{t-1}}) on a training sample Xtrain\mathbf{X}_{train}. Learning consists of two separate stages: model structure selection and picking the optimal leaf values. The way of choosing the model structure is not important for our work; we refer the interested reader to existing implementations, e.g., Chen & Guestrin (2016); Dorogush et al. (2017). For picking optimal leaf values, we consider two most commonly used formulas:

Gradient: At leaf ll at step tt, output negative average gradients (calculated at current predictions) over the leaf objects:

This is equivalent to minimizing the empirical loss function w.r.t. the current leaf value by doing a single gradient step in function space (Chen & Guestrin, 2016).

Newton: At leaf ll at step tt, output the negative total gradient divided by the total second derivative over the leaf objects:

This is equivalent to minimizing the empirical loss function w.r.t. the current leaf value by doing a single Newton step in function space (Chen & Guestrin, 2016).

Approach

In this section, we describe our approach to efficiently calculating the influence of training points. Since the notion of “influence” is not rigorously defined and partly intuitive, we need to introduce a well-defined, measurable quantity that aims to capture the desired intuition; we refer to it as a proxy for influence. In this work, we follow the general framework of Koh & Liang (2017) and quantify influence through train set perturbations. We consider two proxies that reflect two natural variations of this approach. First, we describe an algorithm for faster exact leave-one-out retraining of GBDT under the assumption that the model structure remains fixed, and explain how to use that framework for estimating the influence of training points on specific test samples; we then introduce a general approach to obtaining approximations to this scheme for increased computational efficiency. Finally, we derive an iterative algorithm to compute gradients of GBDT predictions w.r.t. the weights of training sample and analyze the resulting expressions.

For the first proxy, following Koh & Liang (2017), we quantify the (negative) influence of a training sample xtrain\mathbf{x}_{train} on a model’s prediction on a test sample F(xtest;w)F(x_{test};\mathbf{w}) as the change of loss on xtest\mathbf{x}_{test} after retraining the model without xtrain\mathbf{x}_{train}:

Infgrad(xtrain,xtest):=L(ytest,F(xtest))−L(ytest,F^\xtrain(xtest)),\mathit{Inf_{grad}}(\mathbf{x}_{train},\mathbf{x}_{test}):=L(y_{test},F(x_{test}))-L(y_{test},\hat{F}_{\backslash x_{train}}(x_{test})), where F^\xtrain\hat{F}_{\backslash x_{train}} is the model retrained without xtrainx_{train}.

Since, in order to rank the training points according to Infgrad(xtrain,xtest)\mathit{Inf_{grad}}(\mathbf{x}_{train},\mathbf{x}_{test}), we would have to compute Proxy 1 for each xtrain\mathbf{x}_{train}, straightforward leave-one-out retraining would be prohibitively expensive even for moderately-sized datasets. Moreover, as mentioned in Section 1, the parametric model framework of Koh & Liang (2017) is not directly applicable here. Thus, a solution tailored specifically for tree ensembles is required.

In the problem definition (Section 2) we noted that training each tree requires picking its structure and leaf values. Moreover, these two operations respond to small training set perturbations differently: the tree structure is piecewise constant (i.e., it either stays the same or changes abruptly), whereas leaf values change more smoothly. Thus, a natural assumption to make is:

The effect of removing a single training point can be estimated while treating each tree’s structure as fixed.

Under Assumption 1, it is thus sufficient to estimate how the leaf values of each tree are going to change. Since selecting optimal feature splits, e.g. via CART (Quinlan, 1986) or C4.5 (Quinlan, 2014) algorithms, is often the computational bottleneck in fitting decision trees, this observation already yields a significant complexity reduction.

Thus, our first algorithm for approximate leave-one-out retraining, LeafRefit, is equivalent to fixing the structure of every tree and fitting leaf values without the removed point. A formal listing of the resulting algorithm is given in Algorithm 1.

Note that the effect of removing a training object xi\mathbf{x}_{i} is twofold: on each step, we have to (1) remove xi\mathbf{x}_{i} from its leaf (Algorithm 1, line 7) and (2) recalculate the leaf values and record the resulting changes of intermediate predictions for each training object (line 14) . Thus, despite improving upon straightforward retraining by not having to search for the optimal tree splits, LeafRefit is still an expensive algorithm. Running it for each training sample has an asymptotic complexity of O(Tn2)O(Tn^{2}); moreover, in practice, for each training step tt it involves an expensive routine of recalculating derivatives for each training point.

1.2 FastLeafRefit

We seek to limit the number of calculations at each step of LeafRefit. Note that, in LeafRefit, we generally cannot make any use of caching the original first and/or second derivatives, since any Δit−1\Delta_{i}^{t-1} (Algorithm 1, line 14) can be nonzero, which forces us to recompute the derivatives for each object. We build on the intuition that, in practice, a lot of Δit−1\Delta_{i}^{t-1} may be negligible; an extreme example is when training samples can be separated in disjoint cliques, i.e., Ilt1=Ilt2  ∀t1,t2=1,…,TI_{l}^{t_{1}}=I_{l}^{t_{2}}\,\,\forall t_{1},t_{2}=1,\ldots,T, l=1…Ll=1\ldots L. In this case, removing each training point only affects its clique Il0:=Il01I_{l_{0}}:=I_{l_{0}}^{1}, since objects not sharing leaves with ii will not be affected: Δit−1=0  ∀t=1...T,i∉Il0\Delta_{i}^{t-1}=0\,\,\forall t=1...T,i\notin I_{l_{0}}. Thus, at each training step tt, we may select a subset of training samplesMethods of selecting UtU^{t} will be given below. UtU^{t} whose deltas we take into account, and suppose A^it−1=Ait−1  ∀i∉Ut\hat{A}_{i}^{t-1}=A_{i}^{t-1}\,\,\forall i\notin U^{t}. We refer to UtU^{t} as the update set. Combining this with caching the original Ait−1A_{i}^{t-1} and sums of derivatives in each leaf, we reduce the asymptotic complexity to O(TnC)O(TnC), where C=max⁡t∣Ut∣C=\max_{t}|U^{t}|, which is a significant reduction if C≪nC\ll n. A formal listing of the resulting algorithm, FastLeafRefit, is given in Algorithm 2.

1.3 Selecting the update set

In Section 3.1.2, we introduced FastLeafRefit, an approximate algorithm potentially achieving lower complexity than LeafRefit. Its definition, however, allowed for an arbitrary choice of the update set UtU^{t} telling us which training points’ prediction changes to take into account at boosting step tt. It is intuitively clear that different strategies of selecting UtU^{t} allow us to optimize the trade-off between computational complexity and quality of approximating leave-one-out retraining; thus, FastLeafRefit provides a principled way of obtaining approximations of different rigor to LeafRefit. Natural strategies for selecting the update set include:

SinglePoint: don’t update any points’ predictions and only ignore the derivatives of ii (the index of the training point to be removed) in each leaf, i.e., Ut=∅U^{t}=\emptyset. Also note that this strategy is equivalent to disregarding dependencies between consecutive trees in GBDT and treating the ensemble like a Random Forest. Its complexity is O(Tn)O(Tn).

AllPoints: make no approximations and update each point at each step, i.e., Ut={1,…,∣Xtrain∣}U^{t}=\{1,\ldots,|\mathbf{X}_{train}|\}. This reduces FastLeafRefit to LeafRefit.

TopKLeaves(k): this heuristic builds on the observation that, at each step tt, each Δjt,j∈Ilt\Delta_{j}^{t},j\in I_{l}^{t} increases over Δjt−1\Delta_{j}^{t-1} by the same amount Δflt\Delta f^{t}_{l} across the leaf ll (see Algorithm 2). Δflt\Delta f^{t}_{l}’s magnitude, in turn, is expected to be larger for leaves where Δjt−1,j∈Ilt\Delta_{j}^{t-1},j\in I_{l}^{t} (and, subsequently, Δgjt\Delta g^{t}_{j}) are already large. Informally, the “snowball” effect holds: the larger the change accumulated in the leaf so far, the greater its value will change. Thus, to exploit this intuition, TopKLeaves(k)\mathit{TopKLeaves}(k) only updates Δjt\Delta_{j}^{t} of training points in kk leaves with the largest accumulated prediction change so far:

Note: despite the speedup from omitting unimportant leaves, this strategy is formally still O(Tn2)O(Tn^{2}) due to the fact that computing UtU^{t} according to Eq. 3 takes O(n)O(n). In practice, overhead for computing Eq. 3 may be negligible because, firstly, sums of Δit−1\Delta_{i}^{t-1} can be quickly computed in a parallel or vectorized fashion and, secondly, because the complexity of addition is negligible compared to, e.g., calculating derivatives. However, if this still poses a problem, a natural way of getting around it is sampling mm training points uniformly from Xtrain\mathbf{X}_{train} and using a sample estimator of Eq. 3. The complexity of FastLeafRefit thus becomes O(Tn[C+m])O(Tn[C+m]), which is useful if m≪nm\ll n.

2 Prediction gradients

In the previous sections we introduced LeafRefit and FastLeafRefit, fast methods of estimating the effect of a training sample on the GBDT ensemble, which can then be used to rank training points, e.g., by their influence on a test point of interest. Under Assumption 1, these methods are valid approximations of leave-one-out retraining, which gives them theoretical grounding. However, as shown in Section 4.3, when Assumption 1 is violated, LeafRefit and FastLeafRefit are no longer valid approximations to Proxy 1.

The intuition underlying Assumption 1, however, still holds: for a small enough perturbation to the training data, the structure will remain fixed, whereas leaf values will still be changing smoothly. Note that retraining the model without a sample ii is equivalent to setting winew=wiold+Δwi;Δwi=−wioldw^{new}_{i}=w^{old}_{i}+\Delta w_{i};\Delta w_{i}=-w^{old}_{i}. This change may be large enough to trigger structural shifts in the ensemble; thus, we need a tool to study a model’s response to smaller (arbitrarily small) perturbations.

An obvious choice for such a tool is the derivative of a model’s prediction w.r.t. a sample’s weight, which was also a crucial tool in the Influence Functions framework from classical statistics (Cook & Weisberg, 1980):

Infgrad(xtrain,xtest):=∂L(ytest,F(xtest))∂wi(xtrain),\mathit{Inf_{grad}}(\mathbf{x}_{train},\mathbf{x}_{test}):=\frac{\partial L(y_{test},F(x_{test}))}{\partial w_{i(x_{train})}}, where i(xtrain)i(x_{train}) is the index of xtrain\mathbf{x}_{train} in Xtrain\mathbf{X}_{train}.

As mentioned above, in the setup of Proxy 2 the statement of Assumption 1 is now guaranteed to hold and is no longer an assumption; we may consider the tree structures to be fixed and only study perturbations of leaf values, which smoothly depend on the weights. Using the chain rule

we can then derive various counterfactuals (e.g., “how would the loss on a test point change if we upweight a training point ii?”), similarly to Koh & Liang (2017). Since we have

for applying Eq. 4 to arbitrary xx (for a fixed ii) it is necessary and sufficient to calculate ∂flt(At−1)∂wi,  t=1…T\frac{\partial f_{l}^{t}(\mathbf{A^{t-1}})}{\partial w_{i}},\,\,t=1\ldots T, l=1…Ll=1\ldots L. Applying Eq. 4 can then be done by running xx though a new tree ensemble having {∂flt(At−1)∂wi}t=1,l=1T,L\{\frac{\partial f_{l}^{t}(\mathbf{A^{t-1}})}{\partial w_{i}}\}_{t=1,l=1}^{T,L} as leaf values.

Expressions for leaf value derivatives depend on the type of leaf formula:In Proposition 1’s statement, arguments such as w\mathbf{w} or AitA_{i}^{t} are dropped for brevity.

where Ilt(i):=I[i∈Ilt]I_{l}^{t}(i):=I[i\in I_{l}^{t}] and J(At)ij:=∂Ajt(w)∂wiJ(\mathbf{A^{t}})_{ij}:=\frac{\partial A_{j}^{t}(\mathbf{w})}{\partial w_{i}}.

First, let us derive the desired expressionThroughout this proof, we add w\mathbf{w} as an extra argument to the functions we study in order to highlight the dependency. for fG;lt(At−1(w),w)f_{G;l}^{t}(\mathbf{A^{t-1}}(\mathbf{w}),\mathbf{w}):

Let us calculate the derivatives of Glt(At−1(w),w)G^{t}_{l}(\mathbf{A^{t-1}}(\mathbf{w}),\mathbf{w}) and HG;lt(At−1(w),w)H^{t}_{G;l}(\mathbf{A^{t-1}}(\mathbf{w}),\mathbf{w}) separately:

Plugging this back into Equations 7 and grouping terms with and without Ilt(i)I_{l}^{t}(i) separately, we get:

which proves the first part of Proposition 1.

For the second part, all we have to change is to substitute HH;lt(At−1(w),w)H^{t}_{H;l}(\mathbf{A^{t-1}}(\mathbf{w}),\mathbf{w}) for HG;lt(At−1(w),w)H^{t}_{G;l}(\mathbf{A^{t-1}}(\mathbf{w}),\mathbf{w}). Its derivative is given by

Just like before, plugging it back into Equations 7 and grouping terms containing and not containing Ilt(i)I_{l}^{t}(i) separately, we get:

This concludes the proof of Proposition 1. ∎

It can be seen from Eq. 6 that leaf value derivatives at step tt depend on the Jacobi matrix J(At−1)ijJ(\mathbf{A^{t-1}})_{ij}. These values, in turn, are connected by a recursive relationship:

Thus, we can calculate leaf value derivatives in an iterative fashion similar to LeafRefit. A formal listing of the resulting algorithm, LeafInfluence, can be found in Algorithm 4.

Besides providing means for analyzing small weight perturbations, two important traits yielding complexity reductions can be seen from Eq. 6:

A. Using Eq. 6, we can write out ∇wflt=(∂flt∂wi)i=1n\nabla_{w}f^{t}_{l}=\left(\frac{\partial f^{t}_{l}}{\partial w_{i}}\right)_{i=1}^{n} in vector form; since computing each ∂flt∂wi\frac{\partial f^{t}_{l}}{\partial w_{i}} involves addition and a vector dot product, ∇wflt\nabla_{w}f_{l}^{t} can then be expressed via vector addition and matrix/vector product for easy parallelization/vectorization.

B. The derivatives {gjt,hjt,kjt}t=1,j=1T,n\{g^{t}_{j},h^{t}_{j},k^{t}_{j}\}_{t=1,j=1}^{T,n} used in Eq. 6 can now be precomputed only once during GBDT training and not for each training object ii whose influence we want to compute. This contrasts LeafInfluence with LeafRefit and FastLeafRefit, where these derivatives had to be recalculated for each ii depending on the values of Δjt−1\Delta_{j}^{t-1}, which change for different ii.

2.2 FastLeafInfluence

The final step to be made is analogous to the transition from LeafRefit to FastLeafRefit: LeafInfluence is, again, O(Tn2)O(Tn^{2}) because it has to compute matrix/vector products with the matrix J(At−1)ijJ(\mathbf{A^{t-1}})_{ij} for every tt. The same approximation that powers FastLeafRefit can be made here as well: at each step, we can select an update set UtU^{t} and only take into account the influences of a subset of training objects on At−1\mathbf{A^{t-1}}. This is equivalent to assuming J(At−1)ij=0  ∀  j∉UtJ(\mathbf{A^{t-1}})_{ij}=0\,\,\forall\,\,j\notin U^{t}, making J(At−1)ijJ(\mathbf{A^{t-1}})_{ij} a sparse matrix with the number of nonzero elements in each row bounded by C:=max⁡t∣Ut∣C:=\max_{t}|U^{t}|. Strategies of selecting UtU^{t} and the resulting asymptotics become the same as described in Section 3.1.3, with the additional benefit of being able to compute the derivatives “off-line.”

Experiments

The experiments that we conduct can be broadly categorized as serving two purposes: (1) studying the fundamentals of our framework and (2) evaluating its quality in two applied problem setups . For the first part, the research questions that we seek to answer are as follows:

RQ1. How well do the different methods introduced in Sections 3.1 and 3.2 approximate their respective influence proxies?

RQ2. Do smaller update sets significantly reduce the runtimes of FastLeafRefit and FastLeafInfluence? Does FastLeafInfluence yield a notable runtime speedup over FastLeafRefit?

For the second part, we proceed by considering two applied scenarios: (1) classification in the presence of label noise, and (2) classification with train/test domain mismatch. Specifically, the research questions for this part are:

RQ3. For Scenario 1, do our methods allow to detect noise in general and, more specifically, to identify training objects most harmful for specific test points?

RQ4. For Scenario 1, how do the proxies and their respective approximations compare in terms of quality?

RQ5. For Scenario 2, are our methods capable of detecting domain mismatch and, moreover, providing recommendations on how to fix it?

2 Datasets and Framework

For our experiments with GBDT, we use CatBoost(cat, 2018) an open-source implementation of GBDT by YandexWe use the “Plain” mode which disables CatBoost’s conceptual modifications to the standard GBDT scheme.. The datasets used for evaluation are: (1) Adult Data Set (Adult, (dat, 1996)), (2) Amazon Employee Access Challenge dataset (Amazon, (dat, 2013)), (3) the KDD Cup 2009 Upselling dataset (Upselling, (dat, 2009)) and, for the domain mismatch experiment, (4) the Hospital Readmission dataset (Strack et al., 2014) . Dataset statistics and corresponding CatBoost parameters can be found in the supplementary material. Since we approach the problem as a search (for influential examples) problem, the main metrics we will be using are ranking metrics - specifically, DCG and NDCG(dcg, 2018) with linear gains.

3 Proxy Approximation Quality

Here, we evaluate how well do variations of FastLeafRefit and FastLeafInfluence match their respective Proxies 1 and 2. For that, we use the Adult Data Set. For LeafRefit, its validity heavily depends on whether Assumption 1 holds; thus, we split the training points into two disjoint sets based on whether they violate Assumption 1 (Changed in Table 2) or not. We then randomly sample n=2000n=2000 points from both groups to ensure that they are equal in size and, in both of them, for each test object, we rank the train points with respect to their influence on this test object. We then measure NDCG@100 with respect to the relevance labels produced by ground-truth rankings induced by the respective proxies for LeafRefit and FastLeafRefit, Proxy 1 and Proxy 2. Finally, we average the results over the test objects. Results are given in Table 2.

Analysis of Table 2 answers our RQ1. Firstly, as expected, LeafRefit and its faster variations only approximate Proxy 1 when Assumption 1 holds. When it does, the quality of FastLeafRefit uniformly increases with the update set size, reaching perfect results for Top64Leaves, which is equivalent to LeafRefit. On the other hand, LeafInfluence approximates Proxy 2 regardless of Assumption 1; the dependency of FastLeafInfluence on the update set is analogous to that of FastLeafRefit. This shows that LeafInfluence is more robust in approximating its corresponding proxy than LeafRefit.

4 Runtime Comparison

In this section, we compare different variations (update set choices) of FastLeafRefit and FastLeafInfluence in terms of their runtimes. For each dataset used in the study, we randomly pick k=100k=100 training objects for influence evaluation, calculate the resulting change in the model (new leaf values for FastLeafRefit and leaf value derivatives for FastLeafInfluence), measure the total elapsed wall time and divide the result by kk to obtain the average time elapsed per one training object. The results are given in Fig. 1.

Firstly, as expected, we observe that smaller update sets considerably reduce the runtimes of our algorithms, with the most radical speedup yielded by SinglePoint due to not having to recalculate any derivatives at all. Secondly, quite naturally, FastLeafInfluence performs much faster than FastLeafRefit, presumably due to vectorization and gradient precomputation (see end of Section 3.2.1). These observations confirm RQ2.

5 Harmful Object Removal

In this experiment, we consider a particular use-case scenario, classification in the presence of label noise, and evaluate whether our methods are able to identify training objects that are (1) noisy, (2) harmful for specific test objects . In order to do that, we randomly select kk training samples,We set k=4000k=4000 for Adult and Amazon, and k=3500k=3500 for Upselling. flip their labels, and obtain GBDT’s predictions on test data before and after noise injection. We then conduct two experiments:

A. We sort the training points in ascending order of average influence on test objects and measure ROC-AUC of noise detection. In addition to variations of FastLeafRefit and FastLeafInfluence, we also compare against (1) A noise detection method exploiting the problem structure, which scores the training points using GBDT’s prediction in favor of the class opposite to its observed label (Detector), (2) actual loss changes after leave-one-out retraining (Leave-One-Out), and (3) ground-truth binary labels of the train object being noisy (Oracle) . The results are given in Fig. 2.

B. We select n=50n=50 test points that suffered the largest Logloss increase, thus simulating problematic test objects. For each of these objects, we sort the training points in ascending order of influence and incrementally remove them from the training set in batches of m=50m=50 objects; on each iteration we measure the relative Logloss reduction both on this given test object and on the whole test set Xtest\mathbf{X}_{test} and, similarly to ranking, calculate DCG using these reductions as gains. Finally, we average these metrics over the nn test points. The results are given in Fig. 3(a) and 3(b).

Firstly, from Fig. 2, we note that all variations of FastLeafRefit and FastLeafInfluence perform strongly on the overall noise detection problem, where they score close to the top-performing Detector. Secondly, our methods greatly outperform their competitors (shown in blue on Fig. 3(a)) in targeting training objects harmful for a particular test object. These two observations confirm the hypothesis of RQ3. Finally, the two parts on Fig. 3 address RQ4 by clearly showing the way in which larger update sets increase quality: while all approximations score comparably in targeting particular test objects, smaller update sets lead to worsening the overall test quality (except for Upselling); in other words, smaller update sets lead to overfitting the targeted test object. Proper configurations of TopKLeaves, on the other hand, allow to “fix” a specific test object without overfitting it (k=8, 22, 64 for Adult and Amazon).

6 Debugging Domain Mismatch

A common issue in the supervised machine learning is domain mismatch. This is a situation, when the joint distribution of points in the test dataset Xtest\mathbf{X}_{test} differs from the one in the labeled training dataset Xtrain\mathbf{X}_{train}. Often in such scenarios, a model fine-tuned on the training dataset fails to produce accurate predictions on the test data. A standard way to cope with this problem is re-weighting Xtrain\mathbf{X}_{train}.

Conclusion

In this work, we addressed the problem of finding train objects that exerted the largest influence on the GBDT’s prediction on a particular test object. Building on the Influence Function framework for parametric models, we derived LeafRefit and LeafInfluence, methods for estimating influences based on their respective proxy metrics, Proxies 1 and 2. By utilizing the structure of tree ensembles, we also derived computationally efficient approximations to these methods, FastLeafRefit and FastLeafInfluence. In our experiments, through considering several applied scenarios, we showed the practical applicability of these approaches, as well as their ability to produce actionable insights allowing to improve the existing model.

Acknowledgments

We would like to thank Anna Veronika Dorogush for valuable commentary and discussions, as well as technical assistance with the CatBoost library.

References

Supplementary 1: Dataset Statistics and CatBoost Parameters

In this supplementary material, we specify the main statistics of the evaluation datasets (Table 1) and values of CatBoost parameters used in the experiments (Table 2):