

This paper offers a unified, model-agnostic, analogy-based framework for extracting relevant attributes and building contrastive explanations for a given classification. Analogical reasoning relies on the idea of comparing items by pairs to discern their similarities and differences, based on an observable sample S of data.
First, adhering to this principle, we propose a pair-based approach to extract relevant attributes via an analogical relevance index (ARI) from Boolean or nominal datasets. We prove properties establishing the behavior of ARI with respect to available samples S. When comparing ARI against established methods such as χ2, mutual information, Shapley, or Sobol indices, empirical evidence highlights the appropriateness of ARI for synthetic datasets, where the classes are generated using specific Boolean functions. ARI also demonstrates robust performance across a diverse range of functions commonly encountered in real datasets. However, some synthetic datasets created from certain functions pose challenges for all indices.
Second, we use analogical classification as a surrogate for explanation provision. Analogical classifiers are rooted on analogical proportions, involving the comparison of two pairs of items (a, b) and (c, d) through statements like “a differs from b as c differs from d”, denoted as a:b::c:d. To explain the classification of an item d, we search for an item c close to d but in a different class, forming a pair (c, d). Then, the analogical classifier extracts pairs (a, b) satisfying a:b::c:d leveraging the relevant features identified earlier. Finally we explain why d belongs to a class distinct from that of c by computing the frequency of pairs (a,b), mirroring the difference between c and d, that lead to the same class change. Standard local methods typically capitalize on examples within the item’s neighborhood for explanation. In contrast, our approach operates beyond the neighborhood, broadening the scope of explanatory power. Experiments on categorical synthetic and real datasets indicate that the proposed framework provides plausible and essentially human-understandable explanations.