Decision Boundary Maps (DBMs) are an effective tool for visualising machine learning classification boundaries. Yet, DBM quality strongly depends on the dimensionality reduction (DR) technique and high dimensional space used for the data points. For complex ML data, DR can create many mixed classes which yield DBMs that are hard to use or even misleading. We propose a new technique to compute DBMs by transforming data space into Shapley space and computing DR on it. Compared to DBMs computed directly from data, our maps have similar or higher quality metric values and visibly more compact, easier to explore, decision zones that better agree with measured model performance.
Figures & tables
Model
Data
Shapley
Dataset
Acc
AP
AR
MA
MP
MR
MA
MP
MR
MNIST
99.6
.996
.995
96.8
.97(.0001)
.97(.0003)
91.8
.93(.01)
.92(.004)
SVHN
95.3
.950
.949
25.3
.27(.02)
.22(.02)
85.4
.86(.005)
.83(.005)
CIFAR-4
89.9
.899
.899
49.4
.51(.002)
.49(.06)
44.4
.63(.08)
.44(.13)
Table 1: Model accuracy (Acc), average precision (AP), average recall (AR). Maps average accuracy (MA), average precision (MP), and average recall (MR) scores, variance shown in brackets.
Figure 1: Data space projections P(D) and DBMs (a,c) and Shapley space projection P(S) and DBMs (b,d), MNIST and CIFAR-4.
Figure 2: Shapley DBM for SVHN with samples A-E from classes having multiple decision zones. A region R is marked where boundaries strongly differ from what the projection plot (Fig. b) conveys.
Figure 3: Samples from MNIST dataset (top) and reconstructed samples based on projections using NNInv trained on data space projections (middle) or projected Shapley values (bottom)
Figure 4: SVHN and CIFAR-4 samples reconstructed using NNInv from data space and Shapley space projections.
Figure 5: (a) Samples taken from the SVHN dataset used in our case study (note that the samples are resized to 28 pixels instead of 32) and (b) a variant of our SVHN case study created by passing samples of classes 3 and 7 through a Sobel filter.
Dataset
N
Ntrain
n
Estimation Time (hours)
MNIST
70k
60k
784
16
SVHN
99k
73k
2352
21
CIFAR-4
24k
20k
2352
5
Table 2: Computation times for Shapley values for all case study datasets, in relation to the size of the dataset (N), the size of their training sets on which Shapley values are calculated ( Ntrain ) and dimensionality (n).
Figure 6: Scatterplots and DBMs for a 10k subset of SVHN using (a) Data space projections P(D) . (b) Shapley space projections P(S) .
Figure 7: Scatterplots and DBMs for MNIST using UMAP. (a) Data space projections P(D) . (b) Shapley space projections P(S) .
Figure 8: Scatterplots and DBMs for SVHN using UMAP. (a) Data space projections P(D) . (b) Shapley space projections P(S) .
Figure 9: Scatterplots and DBMs for CIFAR-4 using UMAP. (a) Data space projections P(D) . (b) Shapley space projections P(S) .
Shapley values, a solution concept from cooperative game theory, have recently become a standard tool for feature credit allocation in machine learning. They provide an axiomatically justified method to fairly distribute a model's prediction among the data features. Shapley values have not yet been applied to explain machine learning models trained on features from topological data analysis. We develop what we believe is the first such approach, focusing on the persistence landscape featurization of persistence diagrams. Because each landscape coordinate is a rank statistic, crediting a model's prediction back to individual persistent homology classes (persistence diagram points) is nontrivial. We introduce LandscapeSHAP, a method for fair credit allocation to persistence diagram points based on a model's prediction. For linear models on persistence landscapes, LandscapeSHAP has a closed form expression that gives the exact Shapley value of every persistence diagram point. In particular, there is no coalition sampling required. We further prove that the four Shapley "fairness" axioms uniquely characterize this credit allocation for any model, not only linear ones. For a general nonlinear model, this unique value can only be calculated exactly from its defining coalition averaging formula, which requires considering all 2N many coalitions, where N is the number of points in the persistence diagram. This is computationally intractable for persistence diagrams of realistic size. We complement the exact linear model result with an efficient Monte Carlo sampling of persistence diagram coalitions. We give convergence rates in terms of number of samples needed to approximate to a desired degree of accuracy. We also prove stability results for the LandscapeSHAP credit allocation, for any model.
Self-Organizing Maps (SOMs) have long been used as exploratory tools for high-dimensional data: they organize objects into a two-dimensional topology that reveals clusters, gradients, sparse regions, dense regions, and boundaries. Yet, in modern data systems, SOMs are typically trained and visualized outside the DBMS, disconnected from the relational data they summarize. We introduce the abstraction of a queryable data map: a learned topological artifact consisting of representatives, neighborhood relations, object assignments, and derived summaries. We instantiate this idea with MapDB, a lightweight prototype that makes SOM artifacts queryable so users can explore data topology without leaving the database. Experimental study shows that SOM training is feasible at moderate analytical scale, that map queries are interactive after materialization, and that SOM regions provide meaningful targets for exploratory SQL.
Denis Mayr Lima Martins, Gottfried Vossen
Department of Computing and Mathematics University of Sao Paulo Ribeirão Preto, São Paulo, Brazil · Department of Information Systems University of Münster Münster, Germany
Numerous methods have been developed to quantify feature attributions in individual predictions for tree ensembles. However, many applications require global measures of feature contributions to overall model performance. Although local attribution scores can be aggregated to characterize feature importance, such summaries do not directly decompose measures of predictive performance, such as R2. This article introduces qshap, available in both R and Python, which provides Shapley decomposition of R2 values for gradient-boosted decision trees (GBDTs) to quantify feature-specific contributions to model performance. By decomposing the quadratic loss of individual observations, qshap provides flexible tools to explore the importance of individual features and observations. qshap currently supports widely used GBDT implementations, including xgboost, lightgbm, and catboost, through a unified tree representation and efficient C++ backends. Its modular design can accommodate other GBDT implementations built from binary decision trees. In addition, we introduce a specialized backend for oblivious trees that exploits their symmetric structure to substantially accelerate computation.