LEURN: Learning Explainable Univariate Rules with Neural Networks
In this paper, we propose LEURN: a neural network architecture that learns
univariate decision rules. LEURN is a white-box algorithm that results into
univariate trees and makes explainable decisions in every stage. In each layer,
LEURN finds a set of univariate rules based on an embedding of the previously
checked rules and their corresponding responses. Both rule finding and final
decision mechanisms are weighted linear combinations of these embeddings, hence
contribution of all rules are clearly formulated and explainable. LEURN can
select features, extract feature importance, provide semantic similarity
between a pair of samples, be used in a generative manner and can give a
confidence score. Thanks to a smoothness parameter, LEURN can also controllably
behave like decision trees or vanilla neural networks. Besides these
advantages, LEURN achieves comparable performance to state-of-the-art methods
across 30 tabular datasets for classification and regression problems.
Caglar Aytekin
# LEURN: Learning Explainable Univariate Rules with Neural Networks

###### Abstract

In this paper, we propose LEURN: a neural network architecture that learns univariate decision rules. LEURN is a white-box algorithm that results into univariate trees and makes explainable decisions in every stage. In each layer, LEURN finds a set of univariate rules based on an embedding of the previously checked rules and their corresponding responses. Both rule finding and final decision mechanisms are weighted linear combinations of these embeddings, hence contribution of all rules are clearly formulated and explainable. LEURN can select features, extract feature importance, provide semantic similarity between a pair of samples, be used in a generative manner and can give a confidence score. Thanks to a smoothness parameter, LEURN can also controllably behave like decision trees or vanilla neural networks. Besides these advantages, LEURN achieves comparable performance to state-of-the-art methods across 30 tabular datasets for classification and regression problems.

## 1 Introduction

Although there is an immense amount of work on explainable artificial intelligence, a human explainable white box neural network still does not exist. The efforts in explainable artificial intelligence has been focused on saliency maps [44, 53, 56, 41, 11, 15, 54, 30, 13], approximation by explainable methods [21, 25, 42, 52, 16, 51], or hybrid models [31, 37, 32, 33, 39, 2, 29, 49, 50]. Many of these works employ some form of decision trees in order to reach explainability. This is due to the commonly assumed understanding that decision trees are more explainable than neural networks since they extract clear rules on input features.

An interesting fact that have been pointed out by several studies, is that neural networks can be equivalently represented as decision trees [5, 55, 7, 34, 46]. This seems to conflict with trying to explain neural networks with decision trees, as they are decision trees themselves. However, the nature of the decision trees extracted by neural networks are different from commonly used ones in two aspects: they are multivariate and their branches grows exponentially with depth. Exponentially growing number of branches hurts global explainability as it may even become infeasible to store the tree. Although one may still focus on local (sample-wise) explanations, multivariate rules are much harder to explain than univariate ones, as they mix features. Finally, with increasing neural network depth, it becomes even harder to make sense of these rules as the contribution of each rule is not clear.

Motivated by above observations, in this paper, we propose a special neural network architecture (LEURN) that provides an exact univariate decision tree where each rule contributes linearly to the next rule selection and the final decision. In the first block, LEURN directly learns univariate rules and outputs an embedding of the rules and response to the rules. Then a linear layer is applied on this embedding in order to find the next rule. In successive blocks, all embeddings from previous blocks are concatenated and given as input to a linear layer. Final layer takes all previous embeddings as input, consists of a single linear layer and an activation based on the application -sigmoid for binary classification, softmax for multiclass classification and identity for regression. Thus, there is a white-box rule selection and final decision making processes with clear contributions of previous rules in a linear manner. Besides human explainability, the proposed architecture provides additional properties such as: feature importance, feature selection, pairwise semantic similarity, generative usage, and confidence scoring.

## 2 Related Work

### Neural Networks for Tabular Data

We have reviewed the difference of commonly used decision trees and neural network extracted ones in the previous chapter. This difference also shows itself in performance of neural networks and decision trees in tabular data. Particularly, in [43], [8] and [19], extensive comparisons of deep learning methods and tree-based methods were made. The comparison output tends to be in favor of tree-based methods in terms of both accuracy, training speed and robustness to dataset size. Following our discussion in previous section, the performance difference should come ei
ther from the multivariate rules or the exponentially growing branches, as these are the only differences between neural network trees and common ones. This highly motivates us to evaluate LEURN on tabular data, as it removes one of these possibilities since it results into univariate trees. Hence, we believe the results of this evaluation is crucial to understand whether the performance gap comes from exponentially growing branches.

Motivated by above, our application focus is structured data, hence we review deep learning based methods for tabular data next.

Majority of works investigate feature transformation [18][47][57][10], transfer-learning [27][40], self-supervised learning [6][4][20], [45], attention [4][20][45], regularizations [23], univariate decisions [1][36] or explicitly tree-like models [22][35] in order to improve deep learning performance on tabular data.

**Feature Transformation:** The approach in [47] suggests transforming tabular data into two-dimensional embeddings, which can be thought of as an image-like format. These embeddings are then utilized as the input for traditional convolutional neural networks. [57] and [10] also takes a similar approach. [18] finds embedding on numerical features are beneficial for deep learning methods.

**Transfer Learning:** In [27], the authors highlight a key advantage of neural models over others: their ability to learn reusable features and to be fine-tuned in new domains. The authors show this via using upstream data. [40] also investigates pre-training strategies for tabular data.

**Attention:**[4] uses sequential attention to select relevant features at each decision step. Tabtransformer [20] also makes use of self-attention. SAINT [45] applies attention differently: Both on rows (samples) and columns (features). [26] is another method that utilizes both row and column attention.

**Self Supervised Learning:**[4][20][45][6] provide ways to incorporate self-supervised learning with unlabeled data to achieve to better performance especially in small dataset size regime.

**Regularization:**[23] investigates the effects of regularization combinations on MLPs' tabular data performance and finds that with correct regularization, MLPs can outperform many alternatives.

**Univariate Decisions:** The Neural Additive Models (NAMs) [1] are a type of ensemble consisting of multiple multilayer perceptrons (MLPs), each MLP being responsible for one input feature thus making univariate decisions. The output values are summed and passed through a logistic sigmoid function for binary classification, or just summed for regression. [36] propose a new sub-category of NAMs that uses a basis decomposition of shape functions. The basis functions are shared among all features, and are learned together for a specific task, making the model more scalable for large datasets with high-dimensional, sparse features.

**Differentiable Explicit Tree Methods:** Although MLPs with piece-wise linear activation functions are already differentiable implicit trees [5], there have been efforts to create other special architectures that results into explicit trees as follows. [22] proposes a gating mechanism for feature representation with attention based feature selection and builds on differentiable non-linear decision trees. In [35], the authors present NODE, a deep learning architecture for tabular data that combines the strengths of ensembles of oblivious decision trees and end-to-end gradient-based optimization with multi-layer representation learning.

We find that univariate decisions and differentiable tree methods are promising in terms of interpretability and in line with our works. Yet, the extracted decision trees in the literature are either soft [35], or non-linear [22] and univariate decisions made in [1][36] are not still explainable. On the contrary, LEURN provides an explainable and exact univariate decision tree.

Out of the above reviewed methods, the approach in [35] (NODE) is the most similar to ours. Hence we find it important here to highlight some key differences. In NODE, each layer contains multiple trees where each tree is trained via differentiable feature selection and decision making via entmax. Note that made decisions and feature selections are soft and there is no exact corresponding tree. In our proposed method, we make hard decisions via quantized \(tanh\) which results into exact univariate decision trees. Another difference is that our feature selection is not explicit, but implicit through learnable feature importances. In NODE,main computational power is spent on feature selection and thresholds for selected features are directly learned. Instead, in our work, we spend main computational power on learning thresholds/rules as weighted combinations of a special embedding of previous responses and previous thresholds. Most importantly, our method is able to explain exactly why a threshold was selected for a particular layer via linear contribution of previous thresholds and their responses. Moreover our method has additional properties such as providing semantic similarity, generative usage, confidence scoring, etc.

### Post-processing Explainers

The linear contributions of previous rules to others and final decision in LEURN is similar to the additive feature attributions mentioned in [28]. LIME [38] and SHAP [28] stand out as popular approaches as they approximate additive feature importances per sample. These approaches are not novel neural network architectures, but they extract approximate explanations from existing neural networks. Thus their additive feature importances are local approximations. LEURN differs from these approaches, because it is a novel neural network architecture and not a post
processing approximate explainer. Moreover, LEURN's additive contributions are exact, not approximations, as they are a built-in feature of the architecture. Finally, LIME and SHAP's additive contributions are only evident for features at decision level, whereas LEURN's additive contributions applies on every processing stage to intermediate rules on finding the next rule, as well as for the final decision.

## 3 Proposed Method

### Decision Tree Analysis of Vanilla Neural Networks

A vanilla neural network with \(n\) layers can be formulated in Eq. 1.

\[\begin{split} NN(\textbf{x})=\mathbf{W}_{n-1}^{T}\sigma(\mathbf{W}_{n-2}^ {T}\sigma(...\mathbf{W}_{1}^{T}\sigma(\mathbf{W}_{0}^{T}\mathbf{x}+\mathbf{\beta}_{0})\\ +\mathbf{\beta}_{1}...)+\mathbf{\beta}_{n-2})+\mathbf{\beta}_{n-1}\end{split} \tag{1}\]

In Eq. 1, \(\mathbf{W}_{i}\) and \(\mathbf{\beta}_{i}\) are respectively the weight matrix and bias vector of a network's \(i^{th}\) layer, \(\sigma\) is an activation function, and **x** the input. Let us consider that \(\sigma\) is a piece-wise linear activation. Then, a layer makes decisions based on whether linear combinations of input features are larger than a set thresholds. This fact was used to extract decision trees from neural networks in [5, 55, 7, 34, 46]. The extracted decision trees differ from commonly used ones in two aspects, which we review as follows.

### Exponentially Growing Branches

Neural networks extract exponentially growing width trees due to shared rules embedded as layer weights. In each layer \(i\), the input's response to a rule is checked per filter \(j\) and the effective operation depends which region of activation the response falls into. This results into \(k^{\sum_{i}m_{i}}\) possible processing paths, where \(k\) is the total number of linear regions in the activation and \(m_{i}\) is the filter number in layer \(i\). This massive tree size hurts explainability in the global sense as it prevents to see all the decision mechanism at once. With today's very deep architectures it even becomes infeasible to store neural network extracted trees. But, this feature doesn't prevent local explainability where the goal is to understand the decision mechanism of the neural network per sample. At this point, we would also like to mention that exponential partitioning via shared rules has close connections to extrapolation, thus generalization [5], hence this may be a favorable property to keep.

### Multivariate Decisions

The decision rules of neural networks are multivariate. This is obvious as the checked rule per filter is whether a linear combination of all features is larger than a value indicated by negative bias for that filter. The set of multivariate rules extracted by vanilla neural networks are difficult to make sense of, as they mix features. This is especially true for large number of features which is usually the case for modern neural networks. Moreover, multivariate decisions make identification of redundant rules very difficult. As stated in [5], neural network extracted decision trees may consist of redundant rules, and the real depth/width may actually be a lot smaller than exponential formulation provided in previous subsection. However, checking whether a set of multivariate rules encapsulates another set is actually very difficult compared to univariate rules. Thus, in this work we wish to avoid this property of neural networks.

### LEURN: Learning Univariate Rules by Neural Networks

In this section, we propose a special neural network architecture that results into univariate rules, while keeping generalization abilities of neural networks. We will refer to this architecture as LEURN. The main idea in LEURN is to learn univariate rules in the form of thresholds in each layer to be directly applied to the batch-normalized (\(BN\)) neural network input \(\mathbf{x}\). In layer \(0\), we directly learn a rule vector \(\mathbf{\tau}_{0}\) elements of which are separate rules for each input variable. To find the rule vector for next layers, we employ the following. For a layer \(i\), first we find an indicator vector \(\mathbf{s}_{i}\) which indicates the category of each input feature \(j\) with respect to the rule \(\tau_{ij}\). This is achieved via a quantized \(tanh\) activation which extracts thresholds around \(\mathbf{\tau}_{i}\), and outputs unique values for each category whose boundaries are indicated by these thresholds. Then, we find an embedding \(\mathbf{e}_{i}\) by element-wise multiplication of the indicator vector \(\mathbf{s}_{i}\) with the activated threshold vector \(tanh(\mathbf{\tau}_{i})\). This jointly encodes the thresholds used in the layer and how the input responded to them. The next thresholds \(\mathbf{\tau}_{i+1}\) are learned by a linear layer (FC) applied on the concatenated embeddings from previous layers \(\mathbf{e}_{0:i}\). LEURN's rule learning is formulated in Eq. 2 and visualized in Fig. 1.

\[\begin{split}\mathbf{s}_{i}=qtanh(BN(\mathbf{x})+\mathbf{\tau}_{i})\\ \mathbf{e}_{i}=\mathbf{s}_{i}tanh(\mathbf{\tau}_{i})\\ \mathbf{\tau}_{i+1}=\mathbf{W}_{i}^{T}\mathbf{e}_{0:i}+\mathbf{\beta}_{i}\end{split} \tag{2}\]

The output of the neural network \(\mathbf{y}\) is calculated from all embeddings as follows.

\[\mathbf{y}=\gamma(\mathbf{W}_{n-1}^{T}\mathbf{e}_{0:n-1}+\mathbf{\beta}_{n-1}) \tag{3}\]

In Eq. 3, \(\gamma\) is the final activation of the neural network. This can be sigmoid or softmax for binary or multi-label classification, or simply identity for regression problems.

In summary, LEURN makes univariate decisions via \(\tau\) rules and quantized \(tanh\) with number of branches equal to \(tanh\) quantization regions. For every branch, a new rule
or final decision is found via weighted linear combination of embeddings, so contribution of each rule and response is additive.

#### 3.2.1 Properties

Next, we make a few observations about LEURN.

**Equivalent Univariate Decision Trees**: LEURN results into univariate decision trees. For an input that is \(n\)-dimensional, in each layer there are \(k^{n}\) possible indicator vectors which corresponds to \(k^{n}\) branches per layer, where \(k\) is the number of regions in quantized \(tanh\). Each branch is separated into another \(k^{n}\) branches in the next layer. Many of these branches are very unlikely to be utilized during training due to the limited number of data, so this rule sharing property helps generalization in inference time as the rules in unseen categories are made up from the seen ones. Note that this final property is a general property of vanilla neural networks as well.

**Explainability**: LEURN is more explainable compared to vanilla neural networks. In vanilla neural networks, the rules in the equivalent decision tree are in the form of multivariate inequalities, whereas in LEURN they are in the form of univariate inequalities. Univariate inequalities are easier to make sense for humans. LEURN is in this sense a white box which makes explanations in the following hypotethical example: Model checked and found that price/earning ratio (PER) of a company is smaller than 20 and operating income increase (OII) was more than 5\(\%\). Based on this outcome, model then checked and found that PER of the company is larger than 15 and OII was less than 10\(\%\). Therefore, model decided to invest 1k$ on the company. Contribution of each rule-check to final invested money was as follows: PE ratio being smaller than 20: +10008, operating income increase being more than 5\(\%\): +10008, PE ratio being larger than 15: -5008, operating income increase being less than 10\(\%\): -5008. As a higher granularity of explainability, LEURN also provides how the PE\(<\)20 and OII\(>\)5 rules linearly contributed to finding PE\(>\)15 and OII\(<\)10 rules.

**Easy Architecture Search**: The last linear layer has fixed output units defined by the problem, the rest of the linear layers also have fixed output units which is equal to neural network input dimensions. This makes neural architecture search easier as there are no hyperparameters in the form of number of features in a layer. The architecture related hyperparameters are only the depth of the network and the number of quantization regions for \(tanh\).

**Feature Selection**: LEURN can do feature selection as follows. Each embedding element is directly related to a particular input feature. The embedded information is critical in finding next rules or in the output of the neural network. Hence, if absolute value of the unit in \(\mathbf{W}_{i}\) that corresponds to a particular feature is or close to zero, it is a clear indicator that the particular feature is uninformative, hence not selected in that layer.

**Feature Importance**: LEURN can extract global feature importance. Last layer's input is all the embeddings used throughout the neural network. Feature importance can then be measured simply by checking the weighted (via \(\mathbf{W}_{n-1}\)) contribution of each embedding element -hence related feature and rule- in the classification, averaged over the training set.

**Pairwise Semantic Similarity**: LEURN can measure semantic similarity between two samples via using any popular distance metric on the embeddings of these samples.

**Generative Usage**: LEURN can be directly used in a generative manner. A training sample can be fed to the neural network and its univariate rules can be extracted. This simply defines a category that belongs to that sample in the form of upper and lower limits for each feature in the input. Then, one can generate a different sample from the same category by sampling randomly from the univariate rules per feature. This is very difficult to do for vanilla neural networks, as it is harder to sample from multivariate inequalities.

**Parametrized Decision Smoothness**: Finally LEURN provides a controlled smoothness in model predictions based on the number of quantized regions \(k\) in the \(qtanh\) function. As \(k\) grows, decision boundaries become smoother, this hyperparameter is useful to provide alternatives to different datasets based on their properties.

Figure 1: LEURN’s Rule Learning
## 4 Experimental Results

### Preliminary Experiments on Toy Data

#### 4.1.1 Parametrized Decision Smoothness

In [19], authors stated three key differences between neural network based methods and tree-based methods. These were: decision boundary smoothness, robustness to uninformative features and rotation invariance. In this section, we experiment on the behaviour of LEURN on a toy dataset and observe that with different \(qtanh\) quantization regions \(k\), LEURN behaves differently in terms of the above three aspects.

For all experiments in this section, we use Half Moon dataset with 10000 training samples and 1000 validation samples. Accuracies are reported on best validation performance in a training.

First, we investigate decision boundary smoothness. For all LEURNs, we have used fixed depth of \(d=2\) and experimented on \(qtanh\) quantization regions in following set: \(k\in\{2,5,10,20\}\). As it can be observed from Fig. 2, as the quantization regions grow, decision boundary becomes smoother. Note that this result is trivially evident without this experiment, but we still provide these figures for completeness.

Second, we rotate the Half Moon dataset with angles in the following set: \(\{0,11.25,22.5,45\}\). We average results of 10 trainings for each quantization region in: \(\{2,5,10,20\}\). To provide a challenging case, we have fixed network depth to 1 in this experiment. As it can be seen from Table 1, as the quantization regions grow, LEURN becomes more robust to rotation, which is a vanilla neural networks-like behaviour according to [19]. Smaller quantization regions struggle to be robust to rotation, similar to decision tree behaviour, according to [19].

Finally, we experiment on uninformative features. We add 10 additional randomly generated features to Half Moon dataset in order to provide a challenging case with dominating uninformative features. We have used a fixed depth of 3 in this experiment so that all variants are able to provide perfect score without uninformative features. We have observed that all LEURN variants with different quantization regions can successfully handle uninformative features by providing perfect score on validation set.

We conclude from these three experiments that, LEURN provides smoother boundaries (MLP-like) with rotation invariant performance for higher quantization regions, and sharper boundaries with rotation variant performance for lower quantization regions (DT-like). For all cases, LEURN was found to be robust to uninformative features.

#### 4.1.2 Global Feature Importance

We repeat our last experiment in previous section with \(k=2,d=2\). We measure the feature importance as the contribution in the final classification. The process is as follows. The input of the last layer is a concatenation of previous embeddings used throughout LEURN. Each embedding unit corresponds to an information from a particular feature. Thus the value of the multiplied embedding unit with corresponding weight unit in the last layer is treated as that feature's importance. As there are multiple embeddings per feature, we first sum each contributions, then take absolute value of the sum to get the final importance value. Note that these values are calculated over the training set. With this method, we find that informative features in the last experiment, are given at least 4.34 times more importance than uninformative features.

Feature importance can also be calculated in all intermediate fully connected layers. It can also be calculated locally, i.e. for a particular sample instead of over entire training set.

\begin{table}
\begin{tabular}{|c|c|c|c|c|} \hline k & 2 & 5 & 10 & 20 \\ \hline \(\mu\) & 96.79 & 98.44 & 98.76 & 99.01 \\ \hline \(\sigma\) & 3.22 & 1.91 & 1.64 & 1.26 \\ \hline \end{tabular}
\end{table}
Table 1: Mean and standard deviances of LEURNs with different \(qtanh\) quantization regions, across different rotations.

Figure 2: Decision Boundaries of learned LEURN models with different \(qtanh\) quantization regions \(k\), for Half Moon dataset.
#### 4.1.3 Semantic Similarity, Generative Usage and Confidence Scores

In this section we use the RBF kernel response of a pair of LEURN embeddings as a similarity score between corresponding pair of samples. We use Half Moon dataset with several \(k\) and \(d\) hyperparameter choices. In Fig. 3, we select a reference sample from training dataset indicated by the green dot, and visualize semantically similar regions with red dots, we set opacity parameter to similarity value, hence stronger red dots means more similar samples to the reference. Smaller \(k\) and \(d\) results into more distinct and local categories where everything in the category is strongly similar to the reference and similarity sharply stops in category boundaries. On the contrary, larger \(k\) and \(d\) results into distributed and non-local similarities. One can select the desired behaviour based on application.

As LEURN generates univariate trees, there is a distinct category for each sample, this category can be easily found via storing the thresholds that are employed throughout LEURN and finding closest upper and lower boundaries from these thresholds. Note that these thresholds are found through \(\tau\) vectors and \(qtanh\) quantization regions. Every sample in these boundaries have exactly 0 embedding distance, hence 1 similarity to the reference sample. An example of generated samples can be ovserved in Fig 4. We observe that \(h\) and \(d\) grows, the regions gets tighter. This is expected due to the fact that both \(k\) and \(d\) partitions the space into more regions. At first, this can be confused to conflict results of Fig. 3, however we remind the reader that most red dots in Fig. 3 do not have exactly 1 similarity, thus -although semantically similar- not exactly in same category with reference sample. Moreover some regions may vary depending on the category that each training finds due to the random initialization.

The embedding similarity can also be used to assign confidence scores to predictions in test set. We simply find the maximum similarity that a test sample has to training dataset in the nearest neighbour sense. This value is directly used as a confidence score. In Fig. 5, we visualize confidence scores via setting confidence score to opacity. Similar to our other observations in this section, lower \(k\) and \(d\) values result into larger regions that have high confidence

Figure 4: Generated samples from region that reference sample (green) falls into

Figure 3: Embedding similarities to reference sample for LEURN models with different \(qtanh\) quantization regions \(k\) and depths \(d\), for Half Moon dataset.
whereas higher \(k\) and \(d\) values result into tighter categories, thus lower confidence scores in extrapolated regions.

### Explainability

As observed from Eq. 2 and 3, contribution of each embedding in finding the next threshold and the final decision is simply linear. As an embedding is a scalar which encodes a previous threshold and input response to it, it is possible to write linear weights of each previous threshold in finding next threshold according to the input response. There can be sometimes redundant thresholds found in intermediate layers. For the sake of clarity, we handle these as follows. We check whether a previous threshold is above/below the upper/lower limits that are found via previous thresholds. If so, this means that threshold is redundant. Then, the contribution of that threshold in the network is added to the contribution of the previous threshold that defines upper/lower limits. This provides a much clearer and human readable explanation. Note that it also keeps original processing with no alteration, it is just another way to reformulate the neural network/decision tree. Finally, we by-pass the threshold finding mechanisms in the neural network that results into redundant thresholds to further simplify the tree, while keeping it equivalent to the original one. Finally, we distribute the contribution of the biases to each rule equally.

Next, we test explainability module on two cases: Half-Moon and Adult Census Income (OpenML [48]\(\#1590\)) datasets.

#### Toy Data

Next, we explain the decisions of a LEURN trained for the Half Moon dataset with \(k=2\) and \(d=2\). The output of the explanation described in the above paragraph is visualized in Fig. 6 which is the direct output of the explainer module. The corresponding univariate rules utilized in each layer of LEURN are visualized in Fig. 7.

As it can be observed from Fig. 6 and Fig. 7, in the first layer, network checks rules for input features separately. Note that these rules \((x,1.018),(y,0.498)\) are same for any sample/category and these are the only directly learned thresholds in the network. Based on the position of our sample (indicated by green dot in Fig. 7) w.r.t to these rules, network decides to check other rules: \((x,0.181),(y,-0.490)\) respectively. This decision is sensible, since from the position of our sample, it is not clear to which class it belongs to with previous thresholds. The new thresholds tighten the boundary, but still are not sufficient due to a few still-included blue samples in the bounded region. So finally, \((x,-0.998)\) rule is found which is enough to accurately classify our sample.

We also check the contributions of each sensible threshold in the final classification score (last section of Fig. 6). Note that positive score means orange class here. \(x<0.181\) results into a negative contribution in class orange. This is meaningful, because most samples at this region belongs to blue class. \(y<-0.490\) results into a positive contribution in class orange. This is meaningful, because most samples at this region belongs to orange class. \(x>-0.998\) results into a positive contribution in class orange. This is meaningful, because all samples at this region belongs to orange class.

It is also interesting to examine how the previous thresholds contributed to finding the new thresholds. Let us examine the case in Layer 1. \(x<0.181\) pushes to check \((x,-0.009)\) rule whereas \(y<-0.490\) pushes to check \((x,-0.989)\) rule. Note that both are separately enough to classify our sample.

A limitation of the method in terms of explainability is that the rules applied on the input features and their linear contribution to either finding the next rule or making the final decision still needs human effort for interpreta

Figure 5: Confidence scores of samples

Figure 6: Explanation of LEURN for Half-Moon Dataset
tion/speculation. For example, there is no explicit explanation given by the network for why \(y<-0.490\) results into a positive contribution in class orange, but we interpret/speculate it. Still, LEURN simplifies the interpretability problem to an unprecedentedly easy level for humans. We believe best use of LEURN is to assist a human expert in the application field where the human expert is required to verify and make sense of the explanations that LEURN makes in the form of Fig. 6.

### Adult Census Income Dataset

In this section we train LEURN on Adult Income Census dataset. Adult Income Census dataset contains samples having features of an adult's background, and the task is to predict whether the adult earns more than 50000$.

In Table 2, we provide the rules and explanations LEURN finds for a sample. We also compare the additive feature contributions of LEURN and SHAP. Note that SHAP is applied to trained LEURN model.

First we analyze individual feature contributions. The sample is classified as earning more than 50000$ and the largest contributing positive factor was executive managerial job title which makes excellent sense. Other contributing factors were: Education number, Bachelor degree education and married civilian marital status which are sensible. Note that first two are repeating features in the dataset, and both are given high importance which is consistent. An interesting observation is that LEURN finds redundant rules for final weight (fnlwgt) and capital gain features as the found rules that sample belong to exceeds the minimum and maximum values for these features in the dataset. The contributions coming from these redundant rules may be considered as a bias of the particular category. Finally, we observe a non-sensible contribution coming from capital loss. Although the capital loss interval here points towards no loss case, the model assigns a negative contribution here which maybe does not make sense. It is important to note

\begin{table}
\begin{tabular}{|c|c|c|c|} \hline Feature & LEURN Rule & LEURN Scores & SHAP Scores \\ \hline \hline workclass & State-gov & 0.0131 & -0.2027 \\ \hline education & Bachelors & 0.1897 & -0.2514 \\ \hline marital-status & Married-civ-spouse & 0.1719 & 0.7643 \\ \hline occupation & Exec-managerial & 0.2967 & 0.1796 \\ \hline relationship & Husband & 0.0985 & 0.2535 \\ \hline race & White & 0.0117 & -0.0982 \\ \hline sex & Male & 0.0162 & 0.1020 \\ \hline native-country & USA & 0.1193 & -0.9945 \\ \hline age & \(71.75>X>66.79\) & 0.1234 & 0.9786 \\ \hline fnlwgt & \(14254151.00>X>-612719168.00\) & -0.0034 & -0.0244 \\ \hline education num & \(13.13>X>12.83\) & 0.2005 & 0.5779 \\ \hline capital-gain & \(7433545.31>X>-1413678.12\) & -0.0882 & -0.2000 \\ \hline capital loss & \(238.01>X>-10163.00\) & -0.0609 & -0.0912 \\ \hline hours per week & \(40.52>X>39.91\) & -0.0342 & 0.0619 \\ \hline \end{tabular}
\end{table}
Table 2: LEURN Rules, LEURN Scores and SHAP Scores assigned to features of a sample from Adult Income Census Dataset

Figure 7: Utilized univariate rules in every layer.
here that, it is a very important feature to present these rules to humans as non-sensible decisions such as this particular one can be directly visible during monitoring. Although in this particular case this does not alter the final decision, it may be important in some other scenarios.

As the LEURN scores are directly drawn from each feature's and rule's additive contribution in the final layer, they are exact. When this is considered, one would expect that SHAP would extract similar importances per feature. However, it is clearly evident from Table 2 that SHAP explanations deviate considerably from these exact contributions.

Some key differences we see from Table 2 is that SHAP finds native country being USA is one of the biggest negative factors, whereas in reality contribution from that feature is positive. SHAP also shows that a Bachelor degree, a state government job and being white are negative indicators, whereas in LEURN's exact contributions they are positive. Another interesting observation is SHAP gives more importance to being married to a civilian spouse than executive managerial job title, which does not make sense. We observe similar behaviours across the dataset.

### Comparison to State-of-the-Art in Tabular Data

In this section, we provide comparisons to popular methods for tabular data. The methods, datasets and evaluation procedure follows [45] as we use their code for retrieving the datasets, preprocessing and splits. Therefore, the performance of competitor methods have been copy-pasted from [45]. Compared methods are Random Forests [9], Extra Trees [17], k-NN [3], LightGBM [24], XGBoost [12], CatBoost [14], TabNet [4], TabTransformer [20] and SAINT [45]. In Tables 3, 4 and 5, one can find comparisons of LEURN with state-of-the-art methods. Following [45], we have used datasets that are available in OpenML [48], and used OpenML identifiers in the comparison tables. The scores are given in area under receiver operating characteristics curve, accuracy and root mean square error for binary classification, multiclass classification and regression problems respectively.

\begin{table}
\begin{tabular}{||c|c c c c c c c c c c|} \hline Method / OpenML ID & 188 & 1596 & 4541 & 40664 & 40685 & 40687 & 40975 & 41166 & 41169 & 42734 & Average \\ \hline \hline RandomForest & 0.653 & 0.953 & 0.607 & 0.951 & 0.999 & 0.697 & 0.967 & 0.671 & 0.358 & 0.743 & 0.760 \\ \hline ExtraTrees & 0.653 & 0.946 & 0.595 & 0.951 & 0.999 & 0.697 & 0.956 & 0.648 & 0.341 & 0.736 & 0.752 \\ \hline KNeighborsDist & 0.442 & 0.965 & 0.491 & 0.925 & 0.997 & 0.720 & 0.893 & 0.620 & 0.205 & 0.685 & 0.694 \\ \hline KNeighborsUnif & 0.422 & 0.963 & 0.489 & 0.910 & 0.997 & 0.739 & 0.887 & 0.605 & 0.189 & 0.693 & 0.689 \\ \hline LightGBM & 0.667 & 0.969 & 0.611 & 0.984 & 0.999 & 0.716 & 0.981 & 0.721 & 0.356 & 0.754 & 0.776 \\ \hline XGBoost & 0.612 & 0.928 & 0.611 & 0.984 & 0.999 & 0.730 & 0.984 & 0.707 & 0.356 & 0.752 & 0.766 \\ \hline CatBoost & 0.667 & 0.871 & 0.604 & 0.986 & 0.999 & 0.730 & 0.962 & 0.692 & 0.376 & 0.747 & 0.763 \\ \hline MLP & 0.388 & 0.915 & 0.597 & 0.992 & 0.997 & 0.682 & 0.984 & 0.707 & 0.378 & 0.733 & 0.737 \\ \hline TabNet & 0.259 & 0.744 & 0.517 & 0.665 & 0.997 & 0.275 & 0.871 & 0.599 & 0.243 & 0.630 & 0.580 \\ \hline TabTransformer & 0.660 & 0.715 & 0.601 & 0.947 & 0.999 & 0.697 & 0.965 & 0.531 & 0.352 & 0.744 & 0.721 \\ \hline SAINT & 0.680 & 0.946 & 0.606 & 1.000 & 0.999 & 0.735 & 0.997 & 0.701 & 0.377 & 0.752 & 0.779 \\ \hline LEURN & 0.644 & 0.963 & 0.595 & 0.995 & 0.997 & 0.768 & 0.994 & 0.654 & 0.343 & 0.746 & 0.769 \\ \hline \end{tabular}
\end{table}
Table 4: Comparison to state-of-the-art in Multi-Class Classification Datasets

\begin{table}
\begin{tabular}{||c|c c c c c c c c c c|} \hline Method / OpenML ID & 31 & 44 & 1017 & 1111 & 1487 & 1494 & 1590 & 4134 & 42178 & 42733 & Average \\ \hline \hline RandomForest & 0.778 & 0.986 & 0.798 & 0.774 & 0.910 & 0.928 & 0.908 & 0.868 & 0.840 & 0.670 & 0.846 \\ \hline ExtraTrees & 0.764 & 0.986 & 0.811 & 0.748 & 0.921 & 0.935 & 0.903 & 0.856 & 0.831 & 0.659 & 0.841 \\ \hline KNeighborsDist & 0.501 & 0.873 & 0.722 & 0.517 & 0.741 & 0.868 & 0.684 & 0.808 & 0.755 & 0.576 & 0.705 \\ \hline KNeighborsUnif & 0.489 & 0.847 & 0.712 & 0.516 & 0.734 & 0.865 & 0.669 & 0.790 & 0.764 & 0.578 & 0.696 \\ \hline LightGBM & 0.751 & 0.989 & 0.807 & 0.803 & 0.911 & 0.923 & 0.930 & 0.860 & 0.853 & 0.683 & 0.851 \\ \hline XGBoost & 0.761 & 0.989 & 0.781 & 0.802 & 0.903 & 0.915 & 0.931 & 0.864 & 0.854 & 0.681 & 0.848 \\ \hline CatBoost & 0.788 & 0.987 & 0.838 & 0.818 & 0.914 & 0.931 & 0.930 & 0.858 & 0.856 & 0.686 & 0.860 \\ \hline MLP & 0.705 & 0.980 & 0.745 & 0.709 & 0.913 & 0.932 & 0.910 & 0.818 & 0.841 & 0.647 & 0.820 \\ \hline TabNet & 0.472 & 0.978 & 0.422 & 0.718 & 0.625 & 0.677 & 0.917 & 0.701 & 0.830 & 0.603 & 0.694 \\ \hline TabTransformer & 0.764 & 0.980 & 0.729 & 0.763 & 0.884 & 0.913 & 0.907 & 0.809 & 0.841 & 0.638 & 0.823 \\ \hline SAINT & 0.790 & 0.991 & 0.843 & 0.808 & 0.919 & 0.937 & 0.921 & 0.853 & 0.857 & 0.676 & 0.859 \\ \hline LEURN & 0.772 & 0.985 & 0.817 & 0.810 & 0.915 & 0.930 & 0.912 & 0.858 & 0.848 & 0.649 & 0.850 \\ \hline \end{tabular}
\end{table}
Table 3: Comparison to state-of-the-art in Binary Classification Datasets
For all trainings, we perform automatic hyperparameter selection as follows. LEURN has three hyperparameters: depth (\(d\)), tanh quantized region number (\(k\)) and dropout rate (\(r\)). We define search intervals \(d\in\{0,1,2,5,10\}\), \(k\in\{1,2,5,10\}\), \(r\in\{0,0.1,0.3,0.5,0.7,0.9\}\). During hyperparameter search, first we set \(k=1,r=0.9\) (most regularized case) and find best depth. We sweep \(d\) from smallest to largest and stop search when performance metric becomes worse. Next, with \(d=d_{best}\) and \(r=0.9\) set, we sweep \(k\) from smallest to largest and stop when there is no improvement. Finally, we set \(d=d_{best}\) and \(k=k_{best}\), and sweep \(r\) from largest to smallest and stop when there is no improvement. In the above process, the main idea is to start from most regularized case, and check performance improvement when regularization is softened in a controllable way. The search order of \(d,k,r\) is emprical. When performance metric is checked in each stage, we perform 5 trainings with random training and validation sets where best performance is found via best validation error.

Once hyperparameter search is complete, we perform 20 trainings with selected hyperparameters on random training, validation and test splits. We save best performing model on validation data, and report test performance averaged over 20 trainings. The split ratios follow [45].

As one can observe, LEURN is comparable and sometimes favorable to state-of-the-art methods, while having explainability advantages.

## 5 Conclusion

We have introduced LEURN: Learning explainable univariate rules with neural networks. We have shown that LEURN makes human explainable decisions by its special design that results into learning rules with additive contributions. Several other advantages of LEURN was highlighted and tested on a toy dataset. LEURN was tested on 30 public tabular datasets, and it was found comparable to state-of-the-art methods.
