Skip to main content

Synthetic temporal structural causal models with interventions for causal foundation models

Project description

PyPI Python License: Apache 2.0 Docs HF datasets DOI CI

DoTime

A synthetic benchmark generator for interventional and counterfactual time series.

dotime samples multivariate temporal structural causal models (SCMs), applies interventions to them, and produces paired observational / interventional trajectories together with exact counterfactual targets.

Where most time-series causal benchmarks are observational (recover a graph from passive dynamics), DoTime is interventional / counterfactual: it answers do(...) queries over time and ships frozen suites to measure how well a model estimates interventional effects.

Highlights

  • Four intervention regimes — hard, soft, time-varying, and continuous-time intervention windows.
  • Four counterfactual sampling modesprior, observed_discrete, observed_normal, observed_uniform, with a positivity guard.
  • Regime-switching SCMs as a strict generalization of interrupted-time-series.
  • Eight named identification structures (back-door, front-door, IV, …) with exact counterfactual ground truth.
  • Reference baselines and four frozen evaluation suites (released with Zenodo DOIs and Croissant metadata).

Install

pip install dotime            # core generator + suite loaders (CPU, no GPU needed)
pip install 'dotime[baselines]'   # classical / Bayesian baselines
pip install 'dotime[all]'         # everything except dev tooling

Requires Python ≥ 3.10. The core install runs on CPU with no GPU dependency.

Quickstart

from dotime import DoTime

prior = DoTime(seed=42)
X_obs, X_int, intervention, scm = prior.generate_pair(T=100)
# X_obs, X_int: (T, N) tensors;  intervention: InterventionSpec;  scm: TemporalSCM

Command-line:

dotime-generate -n 1000 -T 200 -o data/sample.pt   # sample paired trajectories
dotime-benchmark --list                            # list frozen benchmark suites

Hosted artifacts

Four frozen suites, on the Hugging Face Hub (discovery) and Zenodo (citable archive). load_benchmark("dot-Identifiability-v1") pulls and md5-verifies them.

Suite Episodes Hugging Face Zenodo DOI
dot-Identifiability-v1 10,800 thummd/dot-Identifiability-v1 10.5281/zenodo.20846064
dot-RegimeSwitch-v1 9,999 thummd/dot-RegimeSwitch-v1 10.5281/zenodo.20846074
dot-Continuous-v1 9,999 thummd/dot-Continuous-v1 10.5281/zenodo.20845981
dot-Generic-100k 100,000 thummd/dot-Generic-100k 10.5281/zenodo.20845983

Trained Do-Over-Time-PFN checkpoints: thummd/do-over-time-pfn.

Documentation

Full docs at https://dotime.readthedocs.io. See docs/quickstart.md and docs/benchmarks.md to get started locally.

Citation

If you use DoTime, please cite the paper and the software (see CITATION.cff).

License

Apache-2.0 (code). Released benchmark suites are distributed under CC-BY-4.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dotime-0.1.1.tar.gz (121.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dotime-0.1.1-py3-none-any.whl (132.7 kB view details)

Uploaded Python 3

File details

Details for the file dotime-0.1.1.tar.gz.

File metadata

  • Download URL: dotime-0.1.1.tar.gz
  • Upload date:
  • Size: 121.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dotime-0.1.1.tar.gz
Algorithm Hash digest
SHA256 48c74ce7189464ac62ffa2ba946a0d870b5fda8fdab4fd7bcc79c4fdadcc5573
MD5 6ccf1f9606c8b371018780638a987008
BLAKE2b-256 10b978211ac0f8927c0f74bd9a5570adf32e56660a3084cde8e860a73cdf2703

See more details on using hashes here.

Provenance

The following attestation bundles were made for dotime-0.1.1.tar.gz:

Publisher: release.yml on thummd/dotime

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dotime-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: dotime-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 132.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dotime-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 19fa89191248f5b96c8f3c59f79bbc8c3234198bccccb675e6026c99058f3a16
MD5 734dcb119fe72a4052e007d06db7cf97
BLAKE2b-256 63ffad19ffcea57e69d45a254697f18f279a9a6713cbfd5491ce71ad770a9b72

See more details on using hashes here.

Provenance

The following attestation bundles were made for dotime-0.1.1-py3-none-any.whl:

Publisher: release.yml on thummd/dotime

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page