SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2106.02029 · 2021

Off-Policy Evaluation via Adaptive Weighting with Data from Contextual Bandits

arXiv · PDF · Open in the Atlas

Code that ran

13 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; 0 honoured the contract we drafted, 1 violated it and 12 have no contract verdict; 0 failures of our instrument; 12 no recorded run), measured 2026-11-22; 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/2106.02029.json · badge: /api/ran/2106.02029.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
gsbDBI/contextual_bandits_evaluation canonical (classifier label)
classifier basis: census
13 ran · 12 no recorded run
FunctionStatusWhere it lives
add_config Ran
ran on a synthesized input
gsbDBI/contextual_bandits_evaluation/experiments/plot_utils.py
code served (permissive licence) · get_code("0319ca909f2f12f7")
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 DataFrame. 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 pandas as pd
import numpy as np

# Create sample DataFrames to concatenate
df1 = pd.DataFrame({
    'col1': [1, 2],
    'col2': ['a', 'b']
})

df2 = pd.DataFrame({
    'col1': [3, 4],
    'col2': ['c', 'd']
})

dfs = [df1, df2]

# Create config dict with various keys including policy_names
r = {
    'config': {
        'policy_names': ['policy_a', 'policy_b'],
        'learning_rate': 0.001,
        'batch_size': 32,
        'epochs': 10,
        'model_type': 'transformer'
    }
}

ARGS = {
    'dfs': dfs,
    'r': r
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
aw_estimate Ran
ran on a synthesized input
gsbDBI/contextual_bandits_evaluation/adaptive/inference.py
code served (permissive licence) · get_code("5e041a8094c1a9b3")
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 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

np.random.seed(0)

# T = number of timesteps, K = number of actions/policies
T = 2
K = 4

# scores: AIPW score, shape [T, K]
scores = np.random.randn(T, K)

# policy: policy matrix pi(X_t, w), shape [T, K]
policy = np.random.rand(T, K)
policy = policy / policy.sum(axis=1, keepdims=True)  # normalize to be valid probabilities

# evalwts: non-contextual adaptive weights h_t, shape [T] (optional)
evalwts = np.random.rand(T)

ARGS = {
    "scores": scores,
    "policy": policy,
    "evalwts": evalwts,
}
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 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
bayesian_update Ran
ran, violated the contract we drafted
gsbDBI/contextual_bandits_evaluation/adaptive/region.py
pointer only (licence: MIT); the stored copy get_code serves, from gsbDBI/PolicyLearning, is pointer only (licence: GPL-3.0) · get_code("61cf2d533cff0590")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from gsbDBI/PolicyLearning, and GPL-3.0, as GitHub detects it on that repository, is not in the permissive set Syntology serves inline. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

collect Ran
ran on a synthesized input
gsbDBI/contextual_bandits_evaluation/adaptive/compute.py
code served (permissive licence) · get_code("e168c0099c9d586c")
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 (2,) 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 a simple 2D array with shape [T, K]
# T=2 (time steps), K=4 (number of options to choose from)
arr = np.array([[1.0, 2.0, 3.0, 4.0],
                [5.0, 6.0, 7.0, 8.0]], dtype=np.float32)

# Create indices of shape [T] where each index points to a column in arr
# Valid indices are in range [0, K-1]
idx = np.array([0, 2], dtype=np.int64)

ARGS = {
    "arr": arr,
    "idx": idx
}
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 (2,) — shape (2,) 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
collect3 Ran
ran on a synthesized input
gsbDBI/contextual_bandits_evaluation/adaptive/compute.py
code served (permissive licence) · get_code("1f3bf92682eaa550")
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 (4, 3) 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 a small 3D array with shape [T, T, K]
# Using distinct sizes: T=4, K=3 for clarity
T = 4
K = 3
arr = np.random.randn(T, T, K).astype(np.float32)

ARGS = {
    "arr": arr
}
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 2, dtype family float, shape (4, 3) — shape (4, 3) 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
expand Ran
ran on a synthesized input
gsbDBI/contextual_bandits_evaluation/adaptive/compute.py
code served (permissive licence) · get_code("f3208622d144c3e0")
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, 4) 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

# Small values array of shape [T]
values = np.array([1.5, 2.3, 3.7], dtype=np.float32)

# Indices array of shape [T] with values in range [0, num_cols)
idx = np.array([0, 2, 1], dtype=np.int64)

# Number of columns for expansion
num_cols = 4

ARGS = {
    "values": values,
    "idx": idx,
    "num_cols": num_cols,
}
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 2, dtype family float, shape (3, 4) — shape (3, 4) 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
fit_policylogit Ran
ran on a synthesized input
gsbDBI/contextual_bandits_evaluation/adaptive/policy.py
code served (permissive licence) · get_code("9a6129d06abf86ab")
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 (5, 3) 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 autograd.numpy as npg
from autograd import elementwise_grad as grad
from statsmodels.api import add_constant
from scipy.optimize import minimize

np.random.seed(0)

# Small sample data for fit_policylogit
# xtrain: (n_samples, n_features) - input features
# gammatrain: (n_samples, n_choices) - scores/rewards for each choice
n_samples = 2
n_features = 4
n_choices = 3

xtrain = np.random.randn(n_samples, n_features).astype(np.float64)
gammatrain = np.random.randn(n_samples, n_choices).astype(np.float64)

ARGS = {
    "xtrain": xtrain,
    "gammatrain": gammatrain,
    "reg_mult": 0.01,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
autograd, numpy, scipy, statsmodels — 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 (5, 3) — shape (5, 3) 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
generate_bandit_data Ran
ran on a synthesized input
gsbDBI/contextual_bandits_evaluation/adaptive/datagen.py
code served (permissive licence) · get_code("5f39d54fcc2d1827")
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 tuple. 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
import pandas as pd

np.random.seed(0)

# Create small synthetic data
T_sample = 50
p = 4
X = np.random.randn(T_sample, p).astype(np.float32)
y = np.random.randint(0, 3, T_sample)

ARGS = {
    "X": X,
    "y": y,
    "noise_std": 1.0,
    "signal_strength": 1.0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
read_files Ran
ran on a synthesized input
gsbDBI/contextual_bandits_evaluation/experiments/plot_utils.py
code served (permissive licence) · get_code("836aa78e2dd20418")
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 int; 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 tempfile
import os
import dill as pickle

# Create a temporary directory for test files
temp_dir = tempfile.mkdtemp()

# Create some test pickle files
test_data_1 = [1, 2, 3, 4, 5]
test_data_2 = [6, 7, 8, 9, 10]

file_path_1 = os.path.join(temp_dir, "test_1.pkl")
file_path_2 = os.path.join(temp_dir, "test_2.pkl")

with open(file_path_1, 'wb') as f:
    pickle.dump(test_data_1, f)

with open(file_path_2, 'wb') as f:
    pickle.dump(test_data_2, f)

# Create a glob pattern that matches the test files
file_pattern = os.path.join(temp_dir, "test_*.pkl")

ARGS = {
    "file_name": file_pattern
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
dill — 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 int — 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
ridge_init Ran
ran on a synthesized input
gsbDBI/contextual_bandits_evaluation/adaptive/ridge.py
code served (permissive licence) · get_code("811fd2c220901c6a")
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 tuple. 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

ARGS = {
    "p": 5,
    "K": 3,
}
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 tuple — a tuple output has no array shape of its own; none is 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
ridge_muhat_DM Ran
ran on a synthesized input
gsbDBI/contextual_bandits_evaluation/adaptive/ridge.py
code served (permissive licence) · get_code("79d9cf3e3813bf8b")
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 (2, 4) 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 random seed for reproducibility
np.random.seed(0)

# Define parameters for ridge_muhat_DM
T = 2  # Number of time steps
p = 3  # Number of features
K = 4  # Number of arms/classes

# Create input features: shape (T, p)
xs = np.random.randn(T, p)

# Create arm assignments for each time step: shape (T,)
# Each element should be in range [0, K)
ws = np.array([0, 2], dtype=int)

# Create observations: shape (T,)
yobs = np.random.randn(T)

ARGS = {
    "xs": xs,
    "ws": ws,
    "yobs": yobs,
    "K": K
}
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 2, dtype family float, shape (2, 4) — shape (2, 4) 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
ridge_update Ran
ran on a synthesized input
gsbDBI/contextual_bandits_evaluation/adaptive/ridge.py
code served (permissive licence) · get_code("e715a802e07a495d")
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 tuple. 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

# ridge_update expects:
# A: 2D numpy array (matrix to accumulate outer products)
# b: 1D numpy array (vector to accumulate weighted observations)
# xt: 1D numpy array (feature vector)
# ytobs: scalar (observed target value)

# Initialize small example
np.random.seed(0)

# A: start with a small identity-like matrix (will be augmented)
# Since xt has dimension 4, and we prepend 1, xt1 will have dimension 5
# So A should be 5x5
A = np.eye(5, dtype=np.float64)

# b: vector matching A's dimension (5)
b = np.zeros(5, dtype=np.float64)

# xt: 1D feature vector of dimension 4
xt = np.random.randn(4).astype(np.float64)

# ytobs: scalar observed target
ytobs = 2.5

ARGS = {
    "A": A,
    "b": b,
    "xt": xt,
    "ytobs": ytobs
}
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 tuple — a tuple output has no array shape of its own; none is 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
simple_tree_data Ran
ran on a synthesized input
gsbDBI/contextual_bandits_evaluation/adaptive/datagen.py
code served (permissive licence) · get_code("b07c56c691c23fe1")
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 tuple. 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
from scipy.stats import multivariate_normal

ARGS = {
    'T': 100,
    'K': 4,
    'p': 3,
    'noise_std': 1.0,
    'split': 1.676,
    'signal_strength': 1.0,
    'seed': 42,
    'noise_form': 'normal'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 — a tuple output has no array shape of its own; none is 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
aw_scores Not yet run
unverified (harvested, no recorded run)
gsbDBI/contextual_bandits_evaluation/adaptive/inference.py
code served (permissive licence) · get_code("3bef47a51c280c57")
How it ran

no invocation recorded.

compose_filename Not yet run
unverified (harvested, no recorded run)
gsbDBI/contextual_bandits_evaluation/adaptive/saving.py
code served (permissive licence) · get_code("0972fba26bfbba6e")
How it ran

no invocation recorded.

draw_region Not yet run
unverified (harvested, no recorded run)
gsbDBI/contextual_bandits_evaluation/adaptive/region.py
code served (permissive licence) · get_code("32453c92cde96bcf")
How it ran

no invocation recorded.

draw_thompson Not yet run
unverified (harvested, no recorded run)
gsbDBI/contextual_bandits_evaluation/adaptive/thompson.py
code served (permissive licence) · get_code("23d95e1efad34118")
How it ran

no invocation recorded.

get_sherlock_dir Not yet run
unverified (harvested, no recorded run)
gsbDBI/contextual_bandits_evaluation/adaptive/saving.py
code served (permissive licence) · get_code("c3117fb112f8c8ec")
How it ran

no invocation recorded.

run_experiment Not yet run
unverified (harvested, no recorded run)
gsbDBI/contextual_bandits_evaluation/adaptive/experiment.py
code served (permissive licence) · get_code("9ecb20e1fe43bf2b")
How it ran

no invocation recorded.

run_mab_experiment Not yet run
unverified (harvested, no recorded run)
gsbDBI/contextual_bandits_evaluation/adaptive/experiment.py
code served (permissive licence) · get_code("b4b00b3a088f2fbe")
How it ran

no invocation recorded.

sample_mean Not yet run
unverified (harvested, no recorded run)
gsbDBI/contextual_bandits_evaluation/adaptive/inference.py
code served (permissive licence) · get_code("644dbee79cbb4277")
How it ran

no invocation recorded.

save_data_timepoints Not yet run
unverified (harvested, no recorded run)
gsbDBI/contextual_bandits_evaluation/experiments/plot_utils.py
code served (permissive licence) · get_code("cbc2107c4ed435e0")
How it ran

no invocation recorded.

stats_to_pandas Not yet run
unverified (harvested, no recorded run)
gsbDBI/contextual_bandits_evaluation/adaptive/saving.py
code served (permissive licence) · get_code("523344a7ed793028")
How it ran

no invocation recorded.

ts_mab_probs Not yet run
unverified (harvested, no recorded run)
gsbDBI/contextual_bandits_evaluation/adaptive/experiment.py
code served (permissive licence) · get_code("6efb7af65b214f06")
How it ran

no invocation recorded.

update_thompson Not yet run
unverified (harvested, no recorded run)
gsbDBI/contextual_bandits_evaluation/adaptive/thompson.py
code served (permissive licence) · get_code("afb01149b6292d29")
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, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 24 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.

FunctionAlso present inEarliest-datedOthers named
bayesian_update 1 other paper
1 dated earlier
2105.02344 (2021-05)
Policy Learning with Adaptively Collected Data

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-22.

Repositories linked to this paper

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

Abstract

It has become increasingly common for data to be collected adaptively, for example using contextual bandits. Historical data of this type can be used to evaluate other treatment assignment policies to guide future innovation or experiments. However, policy evaluation is challenging if the target policy differs from the one used to collect data, and popular estimators, including doubly robust (DR) estimators, can be plagued by bias, excessive variance, or both. In particular, when the pattern of treatment assignment in the collected data looks little like the pattern generated by the policy to be evaluated, the importance weights used in DR estimators explode, leading to excessive variance. In this paper, we improve the DR estimator by adaptively weighting observations to control its variance. We show that a t-statistic based on our improved estimator is asymptotically normal under certain conditions, allowing us to form confidence intervals and test hypotheses. Using synthetic data and public benchmarks, we provide empirical evidence for our estimator's improved accuracy and inferential properties relative to existing alternatives.

For agents

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

get_harvested_code_for_paper("2106.02029")
get_code_for_paper("2106.02029")
have("2106.02029")

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

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

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

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

Connect an agent — have() is free.