On Computing Relevant Features for Explaining NBCs

Yacine Izza, Joao Marques-SilvaarXiv 2022

TL;DR

This paper introduces a way to generate concise, rigorous explanations for Naive Bayes Classifiers (NBCs) by trading off a small amount of probabilistic precision for significantly shorter explanations. By leveraging dynamic programming to count models, the authors provide a pseudo-polynomial algorithm that produces "approximate probabilistic explanations" (ApproxPAXp) which are small enough for human decision-makers to easily digest while remaining mathematically grounded.

What Problem Does This Paper Address?

Explainable AI (XAI) currently faces a dilemma between trust and usability.

Popular model-agnostic methods like LIME or SHAP are easy to use but can be "unsound"—they might provide an explanation that is actually consistent with a completely different prediction, which is unacceptable in high-stakes domains like medicine or finance. On the other hand, "formal" XAI methods like Abductive Explanations (AXp) are mathematically rigorous but often produce explanations that are far too long for a human to understand (exceeding the "magical number seven" cognitive limit).

While "probabilistic explanations" ($\delta$-relevant sets) offer a middle ground by finding a small set of features that make a prediction highly likely rather than certain, computing them is generally NP-hard. This paper tackles the challenge of making these rigorous probabilistic explanations computationally feasible for the widely used family of Naive Bayes Classifiers.

Methods

The authors propose a multi-step pipeline to generate these explanations:

  1. Reduction to Linear Classifiers: They first show that a binary NBC can be transformed into an Extended Linear Classifier (XLC). This turns the probabilistic reasoning of the NBC into a weighted sum comparison, similar to a knapsack problem.
  2. Model Counting via Dynamic Programming: To calculate the "precision" of an explanation (the probability that the prediction holds given a subset of features), they need to count how many points in the feature space satisfy the XLC. They adapt dynamic programming techniques used for the #knapsack problem to perform this counting in pseudo-polynomial time.
  3. ApproxPAXp Algorithm: They implement a "deletion-based" greedy algorithm. Starting with a full set of features (or a rigorous AXp), the algorithm iteratively attempts to remove features. A feature is removed only if the remaining set still guarantees the prediction with a probability higher than a user-defined threshold $\delta$ (e.g., 95%).
Figure 1: Running example.

Datasets

The approach was evaluated using 10 publicly available datasets from the UCI Machine Learning Repository and Penn ML Benchmarks, including:

  • Adult: Predicting income levels.
  • Agaricus & Mushroom: Identifying poisonous vs. edible mushrooms.
  • Chess (kr-vs-kp): End-game classification.
  • Vote: US House of Representatives voting records.
  • Mamo, Tumor: Medical diagnostic datasets.

These datasets vary in size (up to ~14,000 instances) and feature count (up to 37 features), providing a robust test for scalability.

Key Insights and Ideas

  • The Precision-Size Trade-off: The "aha moment" is that you don't need 100% certainty to have a useful explanation. By accepting a $\delta$ of 0.95, you can often halve the number of features a human needs to look at.
  • NBC Structure is a Cheat Code: While probabilistic explanations are generally hard to compute for complex models like neural networks, the conditional independence in NBCs allows them to be mapped to knapsack-like structures that dynamic programming can solve efficiently.
  • Monotonicity of Counting: The authors observe that while the precision of an explanation isn't strictly monotonic as you add features, the number of models is. This property is key to making their DP approach work for assessing explanation quality.

Key Results

  • Succinctness: For datasets like agaricus or mushroom, the approximate explanations (ApproxPAXp) were often 2x smaller than the rigorous AXp counterparts.
  • High Precision: Even when setting a lower threshold $\delta$, the actual precision of the generated explanations remained very high, frequently exceeding 97-99%.
  • Efficiency: Despite the theoretical complexity of model counting, the DP approach is incredibly fast in practice. Runtimes were negligible for most datasets, rarely exceeding 2 seconds even for the largest benchmarks.
  • Human-Centric: The algorithm successfully brought explanation lengths down to 3-5 features for many datasets, fitting well within human cognitive limits.

Limitations and Future Work

  • Binary and Categorical Constraints: The current work is restricted to binary classification (two classes) and categorical features. The authors note that extending this to multi-class NBCs is a primary goal for future research.
  • Approximation vs. Optimality: The algorithm produces approximate probabilistic explanations. It doesn't guarantee the absolute smallest set of features (the "Minimum $\delta$-relevant set"). The authors suggest that future work could use SMT (Satisfiability Modulo Theories) solvers to find these cardinality-minimal explanations.
  • Uniform Distribution Assumption: The current model counting assumes features are uniformly distributed. Incorporating actual data distributions could make the explanations even more relevant to real-world scenarios.

Summary updated

BibTeX
@misc{izza2022computing,
  author = {Yacine Izza and Joao Marques-Silva},
  title = {{On Computing Relevant Features for Explaining NBCs}},
  year = {2022},
  eprint = {2207.04748},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2207.04748},
}
Figure