Skip to content

Repository files navigation

Task Exchange

Task Exchange

Statistical inference with synthetic data via task exchangeability.

GitHub License Tests Docs


task-exchangeable-inference provides valid statistical inference when your data are synthetic. It tests whether real and synthetic tasks are exchangeable, builds a kernel‑reweighted reference distribution, applies bias correction, and returns confidence intervals with proper coverage.

Installation

pip install git+https://github.com/Automate-Capture/task-exchangeable-inference.git

Requires Python ≥ 3.10. To work on the project locally:

git clone https://github.com/Automate-Capture/task-exchangeable-inference.git
cd task-exchangeable-inference
pip install -e ".[dev]"
pytest -q

Quick Start

import numpy as np
from task_exchangeable_inference import ExchangeableInference

rng = np.random.default_rng(0)
X = rng.standard_normal((100, 3))
y = X @ np.array([1.0, -0.5, 0.3]) + rng.standard_normal(100) * 0.1

# Fit the exchangeability-corrected estimator on synthetic data
engine = ExchangeableInference()
engine.fit(X, y)

# Predict with calibrated 95% intervals
result = engine.predict_interval(rng.standard_normal((5, 3)), confidence=0.95)
print(result)

Features

  • Exchangeability testing between real and synthetic tasks
  • Kernel‑reweighted reference distribution
  • Bias correction for synthetic‑data estimates
  • Confidence intervals with diagnostics

Modules

Module Description
bias_correction Martingale-based bias correction for synthetic estimators.
cli Command-line interface for task_exchangeable_inference.
diagnostics Runtime diagnostics for exchangeability assumptions.
exchangeability Formal exchangeability model with de Finetti representation.
inference Main inference engine for task-exchangeability with synthetic data.
kernel Exchangeability kernel via Kernel Mean Matching.
repository Task repository for storing and sampling historic tasks.
utils Utility functions for task-exchangeability inference.

Documentation

📖 Full documentation: https://automate-capture.github.io/task-exchangeable-inference/ 📄 Technical paper: see paper/ for the LaTeX source and compiled PDF.

This is a reference implementation produced by an autonomous research pipeline. It is not published to PyPI; install from source as shown above.

License

MIT © Andrew Young / Automate Capture Research