Repository navigation
QuadratureTreeSHAP: shared polynomial construction - #12661
RAMitchell merged 4 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. WalkthroughCPU quadrature TreeSHAP extracts edge terms for each quadrature point. The additive formulation sums these terms. The interaction formulation uses their sum for the split diagonal and cached factors for off-diagonal contributions. The runner invokes formulation hooks during recursion and uses per-thread path-feature buffers. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No actionable issue was found in the inspected contribution and traversal changes; the PR is mergeable after normal checks.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…tions On each return edge, interactions recomputed the edge's per-point terms for every partner feature. Build the terms once per edge, as SHAP values do, and weight them by a per-partner factor that is cached when the partner's path probability changes (Alg. 1 of the QuadratureTreeSHAP paper). The runner keeps the distinct features of the current path in a fixed per-thread buffer. This also removes the per-edge duplicate scan and the vector push/pop that limited multi-threaded scaling. The old path classes are now unused; the next commit removes them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Remove QuadraturePathElement, QuadraturePathView, EmptyQuadraturePathState, LiveQuadraturePathState, ForEachPartner, AccumulatePair and the ResetPath/PushPathSplit/PopPathSplit hooks, which the previous commit left unused. The formulations now only implement HandleReturn. No functional change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
a660418 to
d4fd245
Compare
|
@RAMitchell this branch is updated and ready to be reviewed. |
|
Made a small code style improvement here. Shap/interactions now defined an enterfeature/leavefeature method which is a no-op for shap. |
This PR is split out of #12650 . See that PR for more details, including benchmark results against master for this change and the five related ones.
This PR includes contributions 2, 3, 1 and 6 of #12650. Contributions 2 and 3 are available also in PR #12660. Contributions 1 and 6 change code introduced in 2 and 3 and can not be stand alone. I suggest reviewing and merging #12660 first. I'll then rebase this branch on the new master, and the diff here will show only contributions 1 and 6.
Contribution 1 and 6 are here as they are highly dependent. The change in contribution 1 enables the cleanup in contribution 6.
Contributions 1 and 6 details:
HandleReturn. No speed change. Done in the fourth commit in this branch.