DOCAS
Dose-response Curve Alignment via Synthetic augmentation — train any
fit/predict regressor so its interventional audit curve matches a
user-specified target τ.
observational data → baseline model
→ pick anchors (context rule)
→ label synthetic (x, dose) with τ
→ retrain on real + synthetic
→ audit curve ≈ τ
Install
pip install -e ".[examples]"
# later: pip install docas
Minimal dependency: numpy. Optional: examples, dev.
Quick start
from docas import Aligner
from sklearn.ensemble import HistGradientBoostingRegressor
def train(X, y, sample_weight=None):
m = HistGradientBoostingRegressor(max_depth=3, random_state=0)
m.fit(X, y, sample_weight=sample_weight)
return m
def target(X, u, baseline):
return baseline.predict(X) * (1.0 - 0.3 * u)
result = Aligner(
train_fn=train,
intervention_idx=1,
target=target,
context=lambda X, yhat: yhat > 0.0,
span=1.0,
mode="channel",
).fit(X_train, y_train)
model = result.model_
print(result.alignment_error)
python examples/01_quickstart.py
python examples/02_custom_target.py
python examples/03_sklearn_pipeline.py
Public API
| Symbol | Role |
|---|---|
Aligner |
Domain-agnostic alignment (prefer this) |
audit_curve / probe |
Counterfactual dose sweeps |
InterventionModel |
Extra dose-channel wrapper |
interp_target / linear_fraction |
Build τ from knots / slope |
DOCAS |
Scaled Δ-outcome / glucose research helper |
Layout
src/docas/ # library
examples/ # demos
Manuscript / OhioT1DM study: private repo DOCAS-manuscript.
License
MIT
Metadata
Release files for docas 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| docas-0.1.0.tar.gz | 10.2 kB | Without provenance | Details for docas-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| docas-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for docas-0.1.0-py3-none-any.whl |
Total release size: 21.1 kB
Release files / docas-0.1.0.tar.gz
| Download URL | docas-0.1.0.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
39df3c396b5788738910f091207d223399c384c278b2c035d17277a865801c42
|
|
BLAKE2b-256 checksum How to use checksums |
c2981009f586535f1e7dc0adba710a46ea5be5967c473a7a2732f9fa5e635cce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / docas-0.1.0-py3-none-any.whl
| Download URL | docas-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
50718af65a369b9de7728224a8f16cfa4ac8ac9008b17d566a67a697b96fac34
|
|
BLAKE2b-256 checksum How to use checksums |
752f2cb2b6a3eeab103258373d780a43b37f0d0438864bb61a93dfef2b1863b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Security for docas 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.