qshap_loss: Calculate Q-SHAP Loss Contributions

View source: R/tree_explainer.R

qshap_lossR Documentation

Calculate Q-SHAP Loss Contributions

Description

Computes the feature-specific loss contributions using Q-SHAP decomposition. This is an internal function typically called by rsq().

Usage

qshap_loss(explainer, x, y, y_mean_ori = NULL)

Arguments

explainer

A qshap_tree_explainer object created by gazer()

x

Feature matrix or data frame

y

Response vector

y_mean_ori

Optional pre-computed mean of y (for efficiency)

Value

A matrix of loss contributions with dimensions (n_samples, n_features)


qshap documentation built on Aug. 23, 2026, 5:11 p.m.