TreeBranchMarks

Experiment: woodelf_vs_shapiq_experiment
About this Experiment

This report compares Woodelf against shapiq's TreeExplainer on interventional (background) Shapley values and Shapley interaction values. No path-dependent tasks are included.

The question the experiment is built to answer is where the turn-over point lies: from what data size onward is it worth reaching for Woodelf instead of shapiq?

What is being compared

Task Woodelf shapiq
Background SHAP (order 1) ShapleyValues() max_order=1, index="SV"
Background interactions (order 2, pairwise) ShapleyInteractionValues() max_order=2, index="SII"
Background interactions (order 3) GeneralShapleyInteractionValues(min_order=1, max_order=3) max_order=3, index="SII"

Both sides are configured to compute the same quantity. This was verified before the benchmark was run (XGBoost, California Housing, D=4, T=20, n=2, m=50): order 1 agrees to 1.7e-08, order 2 to 4.8e-09 after undoing Woodelf's shap-package convention of reporting each pair twice at half value, and order 3 to 1.2e-09. Order 3 asks Woodelf for orders 1–3 rather than order 3 alone, because shapiq's max_order=3 computes every order up to 3 internally regardless of min_order — so this keeps the two doing equal work.

Both timings include the model parse: shapiq's TreeExplainer construction (which also preprocesses the background set, and so grows with m) and Woodelf's load_decision_tree_ensemble_model. This is the wall-clock cost a user actually pays to go from a trained model plus data to a set of values.

Datasets and models

All models are XGBoost with T=100 trees, learning_rate=0.1, subsample=0.8, colsample_bytree=0.8.

Dataset Rows Features Task n values m values
California Housing 20,640 8 regression 1, 10, 100, 1,000, 10,000 1, 10, 100, 1,000
Breast Cancer (Wisconsin) 569 30 classification 1, 10, 100, 250 1, 10, 100, 250
Fraud Detection (IEEE-CIS) 590,540 397 classification 1, 10, 100, 1,000, 10,000 1, 10, 100, 1,000

Breast Cancer holds only 569 rows, so the 1,000 and 10,000 points cannot be sampled from it without replacement; its values stop at 250 (n + m = 500 ≤ 569). Recording n = 10,000 for what is really a 569-row run would be misleading, so the dataset instead contributes the “few rows, many features” corner of the comparison.

Sweeps — trimmed to the crossing band

Not every combination of those n and m values is measured. The experiment deliberately skips cells where Woodelf wins by more than about 30×: each such cell costs shapiq a full time budget to confirm a foregone conclusion, and tells us nothing about where the threshold sits.

The rule is a single number per (dataset, order). shapiq costs build(m) + n × per_row(m) with per_row very close to linear in m, while Woodelf is near-flat across this whole range — so setting the two equal makes the crossing a curve of constant n × m. Measured crossing products (D = 6, T = 100):

DatasetOrdershapiq per-row costWoodelfCrossing n×m
California Housing1–3≈ 0.0095 × m s≈ 2.5 s≈ 300
Breast Cancer1–3≈ 0.0055 × m s≈ 0.3 s≈ 60
Fraud Detection1, 2≈ 0.006 × m s≈ 2.5 s≈ 400
Fraud Detection3≈ 0.00087 × m s≈ 3.9 s≈ 4,500

Fraud order 3 sits an order of magnitude higher than its own order 2 because 397 features push shapiq past its dense-buffer limit and onto the sparse kernel, which is substantially faster than the dense path it uses at order 2.

m stops at 1,000 for the same reason: by m = 1,000 shapiq already loses at n = 1 on every dataset, so an m = 10,000 column could only re-confirm a Woodelf win — at roughly 107 s per cell, the most expensive cells in the experiment.

How long runs are handled

Interventional shapiq costs roughly O(n × m) and explains one row at a time — explain_X is a plain Python loop over rows. Cells past the crossing would run for hours, so they are not measured to completion. Instead shapiq explains rows until a wall-clock budget (45 s) is spent and the result is extrapolated linearly in n:

total = build_time + (loop_time / rows_done) × n

Such cells are marked estimated in the report and are still scored — an extrapolated time is real performance data. The extrapolation is linear only in the dimension that genuinely is linear: per-row cost is stable across rows, and m is never extrapolated, since the full background set is always handed to the explainer. Rows are drawn from an already-randomised permutation, so the explained prefix is an unbiased sample. Worst-case cost of a cell is the explainer build plus one row.

Woodelf is left uncapped — it never needed a cap. The most expensive cell measured anywhere was 8.4 s (Fraud, n = m = 10,000, order 3).

Reading the report

Per group (dataset, mission, task, n, m, D, ensemble) the faster method scores 100 and the slower scores (winner / loser) × 100. Because shapiq's cost grows with n × m while Woodelf's stays near-flat, each n-sweep mission crosses exactly once: read off the smallest n at which Woodelf takes the lead, and compare that n across the m values to trace the threshold curve.

One caveat on the trimmed design: the crossing products above were used to choose which cells to run, so the measured crossings will land near the middle of each sweep by construction. That is selection of where to look, not of what is found — every reported time is measured (or extrapolated in n) independently of the estimates that picked the cell. What the trimming does forfeit is the far field: this report cannot say how large Woodelf's margin grows at n = m = 10,000, only that the margin is already past 30× where the sweeps end.

How to Use This Report

This is an interactive benchmarking report comparing the runtime of different SHAP algorithms across a range of decision tree ensembles and dataset configurations. The sections below explain each part of the report.

Score. Each run compares all methods on the same task and parameters. The fastest method of each run scores 100; every other method scores (winner time / its time) × 100, so a method that took twice as long scores 50. Methods that crashed or are not supported for that task score 0. The overall score is the average across all runs.

Filtered score. The filter bar lets you narrow the score to a specific subset of runs by task type and parameter range. The key parameters are: n — the number of explained samples, m — the background dataset size (relevant for Background SHAP), and D — the maximum tree depth. The score updates instantly to reflect only the selected runs.

Experiment Analysis. The report contains many experiments. Each experiment changes one parameter while keeping the others fixed (for example, changing the tree depth D while keeping n and m fixed, or changing n while keeping D and m fixed). Use the Dataset and Mission dropdowns to choose an experiment. The plot will then show the runtime of each method in any value of the swept parameter. This makes it easy to compare methods and see how the parameter affects performance.

Open the Details: dataset, model & approaches panel below the controls to inspect the exact configuration of the selected experiment.

All Results. A full table of every individual run, including measured and extrapolated runtimes, the task type, and all parameter values. Times marked with * were extrapolated from runs with fewer trees and/or fewer samples.

Analytics. Summary statistics and method win-rate charts aggregated over all runs. Use the filters in this section to focus on a specific task type or a narrower parameter range.

Experiment Analysis

Details: dataset, model & approaches

Analytics

Missions

Methods

All Results