Skip to main content
. 2025 Feb 10;8:1506074. doi: 10.3389/frai.2025.1506074

Algorithm 1.

The dual explanation algorithm.

Require: Training set T; the black-box model f; explainable point x0; the number of nearest neighbors K
Ensure: Important features of x0 (vector a=(a1,...,am)T of the linear surrogate model coefficients)
1: Determine a set TK of K nearest neighbors for x0 adding x0 itself
2: Construct the largest convex hull P of TK
3: Find extreme points of P and their number dK+1
4: Generate uniformly n points λ(j), j = 1, ..., n, from the unit simplex Δd−1
5: Find predictions zi of the black-box model in accordance with associated input i=1dλi(j)xi* for all i = 1, ..., n
6: Construct a new dual dataset D={(λ(1),z1),...,(λ(n),zn)}
7: Train the linear regression (Equation 8) on dataset D and find the vector of coefficients b=(b1,...,bd)T
8: Find vector a by solving optimization problem (Equation 15)