SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2006.09481 · ICML · 2020

Efficient nonparametric statistical inference on population feature importance using Shapley values

Brian Williamson, Jean Feng

arXiv · PDF · Open in the Atlas

Code that ran

15 of 25 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 13 failures of our instrument; 10 no recorded run), measured 2026-11-21; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2006.09481.json · badge: /api/ran/2006.09481.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
bdwilliamson/vimpy community
Papers with Code archive
14 ran · 10 no recorded run
bdwilliamson/spvim_supplementary community
Papers with Code archive
1 ran · 0 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
bdwilliamson/vimpy/vimpy/spvim.py
code served (permissive licence) · get_code("5efa7eb653ea329a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Case 1: 1D predictions (single model)
y_1d = np.array([0, 1, 1, 0, 1])
preds_1d = np.array([0, 1, 0, 0, 1])

# Case 2: 2D predictions with single column
y_2d_single = np.array([0, 1, 1, 0, 1])
preds_2d_single = np.array([[0], [1], [0], [0], [1]])

# Case 3: 2D predictions with multiple columns (ensemble)
y_2d_multi = np.array([0, 1, 1, 0, 1])
preds_2d_multi = np.array([[0, 1], [1, 1], [0, 0], [0, 1], [1, 0]])

# Use the multi-column case as it exercises the most code paths
ARGS = {
    "y": y_2d_multi,
    "preds": preds_2d_multi
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, sklearn, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
auc Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
bdwilliamson/vimpy/vimpy/spvim.py
code served (permissive licence) · get_code("b3b4f79c3ab9cdf9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Create binary classification data
# y: binary labels (0 or 1)
y = np.array([0, 1, 1, 0, 1, 0])

# preds: predictions - test with 1D array first
preds_1d = np.array([0.1, 0.9, 0.8, 0.2, 0.7, 0.3])

# Also create 2D predictions for multi-class/multi-output scenarios
preds_2d_single = np.array([[0.1], [0.9], [0.8], [0.2], [0.7], [0.3]])
preds_2d_multi = np.array([
    [0.1, 0.2, 0.7],
    [0.9, 0.05, 0.05],
    [0.8, 0.1, 0.1],
    [0.2, 0.7, 0.1],
    [0.7, 0.2, 0.1],
    [0.3, 0.6, 0.1]
])

# Test with 1D predictions
ARGS = {
    'y': y,
    'preds': preds_1d
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, sklearn, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
auc_ic Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
bdwilliamson/vimpy/vimpy/spvim.py
code served (permissive licence) · get_code("514d20b055ecbe1b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (3, 6) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Set seed for reproducibility
np.random.seed(0)

# Create small test data
# y: binary outcomes (0 or 1)
y = np.array([0, 1, 0, 1, 1, 0])

# preds: predictions - test with 2D array with multiple columns
preds = np.array([
    [0.1, 0.2, 0.3],
    [0.8, 0.7, 0.6],
    [0.2, 0.3, 0.4],
    [0.9, 0.85, 0.75],
    [0.7, 0.6, 0.5],
    [0.15, 0.25, 0.35]
], dtype=np.float32)

ARGS = {
    "y": y,
    "preds": preds
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (3, 6) — shape (3, 6) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
choose Ran
ran, honoured the contract we drafted
bdwilliamson/vimpy/vimpy/spvim.py
code served (permissive licence) · get_code("96c2d58d78728d79")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import math

def choose(n, k):
    import math
    return int(math.factorial(n) / (math.factorial(k) * math.factorial(n - k)))

ARGS = {
    'n': 5,
    'k': 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
cross_entropy Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
bdwilliamson/vimpy/vimpy/spvim.py
code served (permissive licence) · get_code("64ed85c06ce35e76")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

torch_seed = 0

# Create simple numpy arrays for y (binary outcomes) and preds (predictions)
# Test case 1: 2D predictions with multiple columns
y = np.array([0, 1, 0, 1, 1, 0])
preds_multi = np.array([
    [0.1, 0.9],
    [0.8, 0.2],
    [0.3, 0.7],
    [0.6, 0.4],
    [0.2, 0.8],
    [0.9, 0.1]
])

# Test case 2: 2D predictions with single column
preds_single = np.array([
    [0.1],
    [0.8],
    [0.3],
    [0.6],
    [0.2],
    [0.9]
])

# Test case 3: 1D predictions
preds_1d = np.array([0.1, 0.8, 0.3, 0.6, 0.2, 0.9])

# Create ARGS dictionary with 2D multi-column predictions as primary test
ARGS = {
    "y": y,
    "preds": preds_multi
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
deviance Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
bdwilliamson/vimpy/vimpy/spvim.py
code served (permissive licence) · get_code("f22751c60cbae69a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# The function expects:
# - y: outcome array that supports np.mean(y, axis=0) and np.log()
# - preds: predictions array that can be 1D or 2D

# Create a simple binary classification scenario
# y should be a 2D array of binary labels (one-hot or probabilities)
y = np.array([
    [1, 0],
    [0, 1],
], dtype=np.float32)

# preds should be predictions - test with 2D array with multiple columns
preds = np.array([
    [0.9, 0.1],
    [0.2, 0.8],
], dtype=np.float32)

ARGS = {
    "y": y,
    "preds": preds,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
make_folds Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
bdwilliamson/vimpy/vimpy/spvim.py
code served (permissive licence) · get_code("a6fd8ce09cf07e2f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (8,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

np.random.seed(0)

# Create a small binary classification label array
y = np.array([0, 0, 1, 1, 0, 1, 0, 1])

# Number of folds
V = 3

ARGS = {
    "y": y,
    "V": V,
    "stratified": True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (8,) — shape (8,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
one_auc_ic Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
bdwilliamson/vimpy/vimpy/spvim.py
code served (permissive licence) · get_code("315e68efb0762ec6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (10,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Set seed for reproducibility
np.random.seed(0)

# Create sample data for one_auc_ic
# y: binary outcome (0 or 1)
# preds: predictions (scores between 0 and 1)

n_samples = 10
y = np.array([0, 1, 0, 1, 0, 1, 0, 1, 0, 1], dtype=int)
preds = np.array([0.1, 0.9, 0.2, 0.8, 0.15, 0.85, 0.25, 0.75, 0.3, 0.95], dtype=float)

ARGS = {
    'y': y,
    'preds': preds
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (10,) — shape (10,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
one_r2_ic Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
bdwilliamson/vimpy/vimpy/spvim.py
code served (permissive licence) · get_code("38bb504d66f788f8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (5,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import torch

# Construct valid arguments for one_r2_ic function
torch.manual_seed(0)

# Create small sample data
# y: outcome variable - shape (5,) for a small batch
y = np.array([1.0, 2.0, 3.0, 4.0, 5.0])

# preds: predictions - same shape as y
preds = np.array([1.1, 1.9, 3.2, 3.8, 5.1])

ARGS = {
    "y": y,
    "preds": preds
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (5,) — shape (5,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
r_squared Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
bdwilliamson/vimpy/vimpy/spvim.py
code served (permissive licence) · get_code("534144f19cbd0ac6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create sample data for y (outcomes)
y = np.array([1.0, 2.0, 3.0, 4.0, 5.0])

# Create sample predictions - test both 1D and 2D cases
# Using 2D with multiple columns to test the list return case
preds = np.array([
    [1.1, 0.9],
    [2.2, 1.8],
    [3.1, 2.9],
    [4.0, 4.1],
    [5.2, 4.8]
])

ARGS = {
    "y": y,
    "preds": preds
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
r_squared_ic Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
bdwilliamson/vimpy/vimpy/spvim.py
code served (permissive licence) · get_code("85ce6da752e9ae14")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned ndarray, ndim 2, dtype family float, shape (3, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create sample data for y and preds
np.random.seed(0)

# y: outcome variable - 1D array
y = np.array([1.0, 2.0, 3.0, 4.0, 5.0])

# preds: predictions - can be 1D or 2D
# Test with 2D array with multiple columns
preds = np.array([
    [1.1, 1.2, 1.3],
    [2.1, 2.2, 2.3],
    [3.1, 3.2, 3.3],
    [4.1, 4.2, 4.3],
    [5.1, 5.2, 5.3]
])

ARGS = {
    "y": y,
    "preds": preds
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (3, 5) — shape (3, 5) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
shapley_hyp_test Ran
ran; our contract draft was wrong, not the code
bdwilliamson/vimpy/vimpy/spvim.py
code served (permissive licence) · get_code("8e32ea0b9aa76ef2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from scipy.stats import norm

# Set random seed for reproducibility
np.random.seed(0)

# Create small test data
p = 3  # number of features

# vs_one_1: one-feature measures of predictiveness (array of length p)
vs_one_1 = np.array([0.5, 0.6, 0.7])

# v_none_0: null-model predictiveness (scalar)
v_none_0 = 0.2

# sigmas_one: standard errors for one-feature measures (array of length p)
sigmas_one = np.array([0.1, 0.12, 0.15])

# sigma_none: null-model standard error (scalar)
sigma_none = 0.08

# delta: value for testing (scalar)
delta = 0

# level: significance level (scalar)
level = 0.05

ARGS = {
    "vs_one_1": vs_one_1,
    "v_none_0": v_none_0,
    "sigmas_one": sigmas_one,
    "sigma_none": sigma_none,
    "delta": delta,
    "level": level,
    "p": p
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
shapley_influence_function Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
bdwilliamson/spvim_supplementary/code/data_analysis/get_influence_functions.py
code served (permissive licence) · get_code("610ae143866b4724")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Create small matrices for the function
# Z: subsets of power set with estimates (n_subsets x n_features)
n_subsets = 5
n_features = 4
Z = np.random.randn(n_subsets, n_features)

# z_counts: counts for each subset (used in np.repeat)
z_counts = np.array([2, 3, 1, 2, 1])

# W: weight matrix (n_subsets x n_subsets)
W = np.eye(n_subsets)

# v: estimated predictiveness (n_subsets,)
v = np.random.randn(n_subsets)

# psi: estimated Shapley values (n_features,)
psi = np.random.randn(n_features)

# G: constrained ls matrix (3 x n_features) - needs to have 3 rows for QR decomp slicing
G = np.random.randn(3, n_features)

# c_n: constraints (can be any shape, not used in function body)
c_n = np.array([0.1, 0.2, 0.3])

# ics: list of all ics (n_subsets,)
ics = np.random.randn(n_subsets)

# measure: predictiveness measure (string, not used in function body)
measure = "shapley"

ARGS = {
    "Z": Z,
    "z_counts": z_counts,
    "W": W,
    "v": v,
    "psi": psi,
    "G": G,
    "c_n": c_n,
    "ics": ics,
    "measure": measure
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
shapley_influence_function Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
bdwilliamson/vimpy/vimpy/spvim.py
code served (permissive licence) · get_code("8468321fa0661658")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Create small matrices for the function
# Z: subsets of power set with estimates - shape (n_subsets, n_features)
n_subsets = 5
n_features = 4
Z = np.random.randn(n_subsets, n_features)

# z_counts: counts for each subset - shape (n_subsets,)
z_counts = np.array([2, 1, 3, 1, 2])

# W: weight matrix - shape (n_subsets, n_subsets)
W = np.eye(n_subsets) + 0.1 * np.random.randn(n_subsets, n_subsets)

# v: estimated predictiveness - shape (n_subsets,)
v = np.random.randn(n_subsets)

# psi: estimated Shapley values - shape (n_features,)
psi = np.random.randn(n_features)

# G: constrained ls matrix - shape (3, n_features) with 3 rows
# Used in QR decomposition where U_2 extracts columns from 3 onwards
G = np.random.randn(3, n_features)

# c_n: constraints - can be a simple array
c_n = np.array([0.1, 0.2, 0.3])

# ics: list of all influence curves - shape should be compatible with Z_W.dot(ics)
# Z_W has shape (n_features, n_subsets), so ics should have shape (n_subsets,)
ics = np.random.randn(n_subsets)

# measure: the predictiveness measure - just a string identifier
measure = "shapley"

ARGS = {
    "Z": Z,
    "z_counts": z_counts,
    "W": W,
    "v": v,
    "psi": psi,
    "G": G,
    "c_n": c_n,
    "ics": ics,
    "measure": measure
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
shapley_se Ran
ran, honoured the contract we drafted
bdwilliamson/vimpy/vimpy/spvim.py
code served (permissive licence) · get_code("98c482a48f51a3d5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create shapley_ics dictionary with the required structure
# The function accesses shapley_ics['contrib_v'] and shapley_ics['contrib_s']
# Both should be 2D arrays where:
# - First dimension is indexed by idx
# - Second dimension is used for variance calculation

# Create sample data with shape (num_indices, num_samples)
num_indices = 5
num_samples = 10

contrib_v = np.random.randn(num_indices, num_samples)
contrib_s = np.random.randn(num_indices, num_samples)

# Add some NaN values to test na_rm parameter
contrib_v[0, 2] = np.nan
contrib_s[1, 3] = np.nan

shapley_ics = {
    'contrib_v': contrib_v,
    'contrib_s': contrib_s
}

# Define arguments
ARGS = {
    'shapley_ics': shapley_ics,
    'idx': 2,
    'gamma': 0.5,
    'na_rm': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
accuracy_ic Not yet run
unverified (harvested, no recorded run)
bdwilliamson/vimpy/vimpy/spvim.py
code served (permissive licence) · get_code("af13607054544c80")
How it ran

no invocation recorded.

compute_ic Not yet run
unverified (harvested, no recorded run)
bdwilliamson/vimpy/vimpy/spvim.py
code served (permissive licence) · get_code("559611a6ba26946d")
How it ran

no invocation recorded.

cross_entropy_ic Not yet run
unverified (harvested, no recorded run)
bdwilliamson/vimpy/vimpy/spvim.py
code served (permissive licence) · get_code("f40e6267444d9487")
How it ran

no invocation recorded.

cv_predictiveness Not yet run
unverified (harvested, no recorded run)
bdwilliamson/vimpy/vimpy/spvim.py
code served (permissive licence) · get_code("1c5b419e1c08be46")
How it ran

no invocation recorded.

deviance_ic Not yet run
unverified (harvested, no recorded run)
bdwilliamson/vimpy/vimpy/spvim.py
code served (permissive licence) · get_code("b03f39be86306d13")
How it ran

no invocation recorded.

get_measure_function Not yet run
unverified (harvested, no recorded run)
bdwilliamson/vimpy/vimpy/spvim.py
code served (permissive licence) · get_code("7834085f6f2c900c")
How it ran

no invocation recorded.

one_accuracy_ic Not yet run
unverified (harvested, no recorded run)
bdwilliamson/vimpy/vimpy/spvim.py
code served (permissive licence) · get_code("6e65685b71563fac")
How it ran

no invocation recorded.

one_cross_entropy_ic Not yet run
unverified (harvested, no recorded run)
bdwilliamson/vimpy/vimpy/spvim.py
code served (permissive licence) · get_code("2d1e9e7840f75757")
How it ran

no invocation recorded.

one_deviance_ic Not yet run
unverified (harvested, no recorded run)
bdwilliamson/vimpy/vimpy/spvim.py
code served (permissive licence) · get_code("434a920696b14b3d")
How it ran

no invocation recorded.

spvim Not yet run
unverified (harvested, no recorded run)
bdwilliamson/vimpy/vimpy/spvim.py
code served (permissive licence) · get_code("f65b08b4141edc84")
How it ran

no invocation recorded.

Also present in other papers' code

Of 25 samples lifted from this paper's linked repositories, 25 carry a function identity and 0 do not. Of the 25 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 25 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-21.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

The true population-level importance of a variable in a prediction task provides useful knowledge about the underlying data-generating mechanism and can help in deciding which measurements to collect in subsequent experiments. Valid statistical inference on this importance is a key component in understanding the population of interest. We present a computationally efficient procedure for estimating and obtaining valid statistical inference on the Shapley Population Variable Importance Measure (SPVIM). Although the computational complexity of the true SPVIM scales exponentially with the number of variables, we propose an estimator based on randomly sampling only Θ(n) feature subsets given n observations. We prove that our estimator converges at an asymptotically optimal rate. Moreover, by deriving the asymptotic distribution of our estimator, we construct valid confidence intervals and hypothesis tests. Our procedure has good finite-sample performance in simulations, and for an in-hospital mortality prediction task produces similar variable importance estimates when different machine learning algorithms are applied.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2006.09481")
get_code_for_paper("2006.09481")
have("2006.09481")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2006.09481.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2006.09481.svg)](https://syntology.ai/paper/2006.09481)

Connect an agent — have() is free.