SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2306.04255 · 2023

Accounting For Informative Sampling When Learning to Forecast Treatment Outcomes Over Time

arXiv · PDF · Open in the Atlas

Code that ran

7 of 9 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 5 have no contract verdict; 0 failures of our instrument; 2 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/2306.04255.json · badge: /api/ran/2306.04255.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
toonvds/tesar-cde canonical (classifier label)
classifier basis: census
7 ran · 2 no recorded run
FunctionStatusWhere it lives
calc_diameter Ran
ran, honoured the contract we drafted
toonvds/tesar-cde/src/utils/cancer_simulation.py
code served (permissive licence) · get_code("49da0ce0fcbb45b8")
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

def calc_diameter(volume):
    return (volume / (4.0 / 3.0 * np.pi)) ** (1.0 / 3.0) * 2.0

# The function takes a volume parameter and performs mathematical operations on it
# volume can be a scalar or numpy array
volume = np.array(100.0)

ARGS = {
    "volume": volume
}
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
calc_volume Ran
ran, honoured the contract we drafted
toonvds/tesar-cde/src/utils/cancer_simulation.py
code served (permissive licence) · get_code("b3ddbda44f74ad61")
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 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 numpy as np

# The function calc_volume takes a diameter parameter and computes sphere volume
# Reading the function body:
# - diameter is used in arithmetic operations (division, exponentiation)
# - It should be a numeric value (int, float, or numpy array)

# Create a simple numeric value for diameter
diameter = 5.0

ARGS = {
    "diameter": diameter
}
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 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
compute_cross_entropy_loss Ran
ran on a synthesized input
toonvds/tesar-cde/src/utils/losses.py
code served (permissive licence) · get_code("c333545f546b687b")
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 Tensor, 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
from torch.nn import functional as F

torch.manual_seed(0)

# Create small tensor arguments
batch_size = 2
num_classes = 4

# outputs: model logits/unnormalized scores
outputs = torch.randn(batch_size, num_classes)

# predictions: should be probability-like (softmax output from model)
predictions = F.softmax(torch.randn(batch_size, num_classes), dim=1)

# active_entries: mask indicating which entries are active
# Based on the function body, this parameter is not actually used
active_entries = torch.ones(batch_size, dtype=torch.bool)

ARGS = {
    "outputs": outputs,
    "predictions": predictions,
    "active_entries": active_entries,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, 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
data_to_torch_tensor Ran
ran on a synthesized input
toonvds/tesar-cde/src/utils/data_utils.py
code served (permissive licence) · get_code("60fc98f2701ea88d")
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 torch
import numpy as np
import random

torch.manual_seed(0)
random.seed(0)

# Create minimal data dict with required keys
# Each array needs specific shape structure based on function usage
batch_size = 2
time_steps = 3
covariate_dim = 4
treatment_dim = 5
output_dim = 6

data = {
    'current_covariates': np.random.randn(batch_size, time_steps, covariate_dim).astype(np.float32),
    'current_treatments': np.random.randn(batch_size, time_steps, treatment_dim).astype(np.float32),
    'future_treatments': np.random.randn(batch_size, time_steps, treatment_dim).astype(np.float32),
    'outputs': np.random.randn(batch_size, time_steps, output_dim).astype(np.float32),
    'active_entries': np.random.randint(0, 2, size=(batch_size, time_steps)).astype(np.float32),
    'obs_probabilities': np.random.rand(batch_size, time_steps).astype(np.float32),
}

ARGS = {
    'data': data,
    'sample_prop': 1,
    'time_concat': -1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — 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
enable_dropout Ran
ran on a synthesized input
toonvds/tesar-cde/src/utils/training_tools.py
code served (permissive licence) · get_code("0001acc4d96a96b7")
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 ModelWithDropout. 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 torch
import torch.nn as nn

torch.manual_seed(0)

class ModelWithDropout(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.dropout = nn.Dropout(p=0.5)
        self.linear2 = nn.Linear(3, 2)
        self.dropout2 = nn.Dropout(p=0.3)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.dropout(x)
        x = self.linear2(x)
        x = self.dropout2(x)
        return x

model = ModelWithDropout()
model.eval()

ARGS = {
    'model': model
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ModelWithDropout — a ModelWithDropout output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ModelWithDropout 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
get_processed_data Ran
ran on a synthesized input
toonvds/tesar-cde/src/utils/data_utils.py
code served (permissive licence) · get_code("5ae2afabd4edc746")
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
import pandas as pd

# Create mock scaling parameters as pandas Series
mean = pd.Series({
    'cancer_volume': 50.0,
    'patient_types': 0.5,
    'chemo_application': 0.0,
    'radio_application': 0.0
})

std = pd.Series({
    'cancer_volume': 10.0,
    'patient_types': 0.2,
    'chemo_application': 1.0,
    'radio_application': 1.0
})

scaling_params = (mean, std)

# Create mock raw_sim_data dictionary
num_patients = 2
num_timesteps = 10

raw_sim_data = {
    'cancer_volume': np.random.randn(num_patients, num_timesteps) * 10 + 50,
    'patient_types': np.random.randn(num_patients) * 0.2 + 0.5,
    'patient_arms': np.random.randint(0, 2, num_patients),
    'intensity_covariates': np.random.randn(num_patients, 3),
    'intensity': np.random.randn(num_patients, num_timesteps),
    'chemo_application': np.random.randint(0, 2, (num_patients, num_timesteps)),
    'radio_application': np.random.randint(0, 2, (num_patients, num_timesteps)),
    'sequence_lengths': np.full(num_patients, num_timesteps),
    'obs_probabilities': np.random.rand(num_patients, num_timesteps)
}

ARGS = {
    'raw_sim_data': raw_sim_data,
    'scaling_params': scaling_params
}
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 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
mse Ran
ran on a synthesized input
toonvds/tesar-cde/src/utils/losses.py
code served (permissive licence) · get_code("58188f1c56c152d6")
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 Tensor, 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

torch.manual_seed(0)

# Create tiny tensors with distinct dimensions for clarity
batch_size = 2
feature_dim = 4

# Ground truth outputs: shape (2, 4)
ground_truth_outputs = torch.randn(batch_size, feature_dim)

# Predictions: shape (2, 4)
predictions = torch.randn(batch_size, feature_dim)

# Active entries: binary mask with shape (2, 4)
# Some entries are active (1.0), some are not (0.0)
active_entries = torch.tensor([
    [1.0, 0.0, 1.0, 0.0],
    [1.0, 1.0, 0.0, 1.0]
])

# Observation probabilities: shape (2, 4) with values in (0, 1]
obs_prob = torch.rand(batch_size, feature_dim) + 0.1  # Ensure no zeros

# Normalization constant
norm = 1150

ARGS = {
    "ground_truth_outputs": ground_truth_outputs,
    "predictions": predictions,
    "active_entries": active_entries,
    "obs_prob": obs_prob,
    "norm": norm
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, 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
get_confounding_params Not yet run
unverified (harvested, no recorded run)
toonvds/tesar-cde/src/utils/cancer_simulation.py
code served (permissive licence) · get_code("95c728dafae2f2ff")
How it ran

no invocation recorded.

process_data Not yet run
unverified (harvested, no recorded run)
toonvds/tesar-cde/src/utils/data_utils.py
code served (permissive licence) · get_code("16a1b88ddd38609a")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 0 later) and 5 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
calc_diameter 2 other papers
2 dated earlier
2002.04083 (2020-02)
Estimating Counterfactual Treatment Outcomes over Time Through Adversarially Balanced Representations
2206.08311 (2022-06)
Continuous-Time Modeling of Counterfactual Outcomes Using Neural Controlled Differential Equations
calc_volume 2 other papers
2 dated earlier
2002.04083 (2020-02)
Estimating Counterfactual Treatment Outcomes over Time Through Adversarially Balanced Representations
2206.08311 (2022-06)
Continuous-Time Modeling of Counterfactual Outcomes Using Neural Controlled Differential Equations
compute_cross_entropy_loss 1 other paper
1 dated earlier
2206.08311 (2022-06)
Continuous-Time Modeling of Counterfactual Outcomes Using Neural Controlled Differential Equations
enable_dropout 1 other paper
1 dated earlier
2206.08311 (2022-06)
Continuous-Time Modeling of Counterfactual Outcomes Using Neural Controlled Differential Equations

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

Machine learning (ML) holds great potential for accurately forecasting treatment outcomes over time, which could ultimately enable the adoption of more individualized treatment strategies in many practical applications. However, a significant challenge that has been largely overlooked by the ML literature on this topic is the presence of informative sampling in observational data. When instances are observed irregularly over time, sampling times are typically not random, but rather informative -- depending on the instance's characteristics, past outcomes, and administered treatments. In this work, we formalize informative sampling as a covariate shift problem and show that it can prohibit accurate estimation of treatment outcomes if not properly accounted for. To overcome this challenge, we present a general framework for learning treatment outcomes in the presence of informative sampling using inverse intensity-weighting, and propose a novel method, TESAR-CDE, that instantiates this framework using Neural CDEs. Using a simulation environment based on a clinical use case, we demonstrate the effectiveness of our approach in learning under informative sampling.

For agents

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

get_harvested_code_for_paper("2306.04255")
get_code_for_paper("2306.04255")
have("2306.04255")

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

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

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

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

Connect an agent — have() is free.