|
pulsatrix
|
Approximates Shapley values via full coalition enumeration + SHAP-kernel-weighted linear regression, reusing fit_weighted_linear_regression for the reduced (n-1)-dimensional problem the efficiency-axiom substitution produces. More...
#include <kernel_shap.hpp>
Public Member Functions | |
| Attribution | explain (const std::function< Tensor(const Tensor &)> &predict, const Tensor &input, const Tensor &baseline, int64_t target_index, DeviceBackend *backend) const |
| Computes Shapley value approximations for one output index. | |
Approximates Shapley values via full coalition enumeration + SHAP-kernel-weighted linear regression, reusing fit_weighted_linear_regression for the reduced (n-1)-dimensional problem the efficiency-axiom substitution produces.
|
inline |
Computes Shapley value approximations for one output index.
| predict | Forward-pass callable: input Tensor in, output Tensor out. |
| input | Input to explain. |
| baseline | Reference "feature absent" input. Must match input's shape. |
| target_index | Which output element to attribute (0-based, flat index). |
| backend | Backend to allocate intermediate tensors through. |