Skip to main content

biohcc

Probe measurement primitives + the BioHCC calibration construction for biomedical hidden-confounding benchmarks.

Probe measures what outcome-relevant hidden-confounding difficulty a benchmark contains and which mechanism-aware comparison that difficulty can support (benefit / equivalence / failure / abstention). BioHCC is a tunable, self-generating PK-PD construction with an exact (quadrature) interventional residual, for calibrating Probe under known causal regimes.

Scope. This is a measurement instrument, not an algorithm-ranking oracle. It reports which comparison a benchmark can support; it does not predict unseen-method or external-cohort performance. BioHCC generates its own synthetic data — the package ships and downloads no external or clinical data (MIMIC / eICU / PhysioNet must be obtained by the user under their own terms and are out of scope here).

Install

pip install biohcc                 # core: numpy only

Quickstart — measure a benchmark residual

import numpy as np
from biohcc import interventional_residual, residual_factorisation, gap_to_fit

# For a frozen (context, action), tabulate over latent draws u:
outcome           = ...  # phi(context, u)              shape (contexts, latent_draws)
action_likelihood = ...  # pi(target_action | context, u)
belief            = ...  # p(u | learner filtration)    (prior for memoryless; belief for persistent)

res = interventional_residual(outcome, action_likelihood, belief)
res["delta"]           # observation-to-intervention residual Delta*
fac = residual_factorisation(outcome, res["likelihood_ratio"], belief)
fac["g_mean"], fac["rho_squared_mean"], fac["chi_squared_mean"]   # g = alignment x assignment info

Quickstart — the BioHCC construction

from biohcc import memoryless_config, persistent_config, certify, certify_report, rollout

res = certify(memoryless_config(kappa_h=1.5, sigma_a=0.55))   # structured result, no printing
res.g, res.dstar, res.invariants_pass, res.certified, res.max_share

certify_report(persistent_config())        # prints the report incl. the prior-vs-belief (R7) trap
O, A, Y = rollout(500, memoryless_config(), seed=0)           # generate a cohort in memory

Map measurements to a decision

design_decision (pre-comparison) and outcome_class (post-comparison) implement the main-text Table I decision map; consequence_class is a thin convenience wrapper over the two. All are pure functions of explicit inputs — no universal threshold is inferred; the caller decides, per construction, what counts as "residual present", "supported", "resolvable" (D_Gamma), etc.

from biohcc import consequence_class

consequence_class(
    residual_present=True, estimand_aligned=True, baseline_recoverable=False,
    correction_channel_available=True, supported=True, resolvable=True,
    recovery_lower_bound=0.4, attribution_lower_bound=0.4, equivalence_margin=0.1,
).label          # -> "benefit"
# Table I precedence: any failed gate (support, applicability, resolvability D_Gamma,
# estimand, provenance) -> "abstention"; a certified structural zero whose registered
# interval lies inside the margin -> "equivalence"; an authorized benefit test not met
# -> "not-confirmed" (or "mechanism-contradicted" if a directional implication reverses).

Command line

biohcc certify  --variant both          # measure BioHCC-M and BioHCC-P certificates
biohcc generate --variant M --n-pat 500 --out cohort.npz
biohcc selftest                         # exact-invariant / identity checks (exit 0/1)
biohcc version

What Probe measures

  • interventional residual Delta* = E_obs[Y|x,a] - E_do[Y|x,a] = Cov_p(w, f) — the discrepancy a correction must remove (zero if the latent does not change the outcome-relevant belief);
  • factorisation g = rho^2 · chi2 — outcome alignment × assignment information;
  • gap-to-fit Q / (Q + E_fit) — an evaluation-design-dependent power coordinate (not a ceiling);
  • plus baseline accessibility, correction-channel availability, support and discriminability, which the caller supplies to consequence_class.

Exact invariants (E_p[w]=1, Delta*=Cov_p(w,f), Cauchy–Schwarz) are checked at run time; a violation means the probe or the simulator is wrong, not that a threshold was crossed.

Citation / provenance

Source repository: https://github.com/anonymous-rl-lab/biohcc. Frozen Zenodo release: https://doi.org/10.5281/zenodo.21621354. Preregistration and confirmatory records: https://osf.io/w62fd. See CHANGELOG.md. License: MIT.

Download files

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

Source Distribution

biohcc-0.5.0.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

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

biohcc-0.5.0-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file biohcc-0.5.0.tar.gz.

File metadata

  • Download URL: biohcc-0.5.0.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.2

File hashes

Hashes for biohcc-0.5.0.tar.gz
Algorithm Hash digest
SHA256 471eccdc42cc8378f76f8f48246470e6dbcb3ae167c34d669063ef5f7e2de263
MD5 5ba59943c40e338c6db6f9dc1b88a20c
BLAKE2b-256 1ac3a696fce8bf19f79d0df99ec52f293ddeff4b68bb049c616feea765cab369

See more details on using hashes here.

File details

Details for the file biohcc-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: biohcc-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.2

File hashes

Hashes for biohcc-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7b335d680e16add719974eed25165bb49e408fc95c8f018b94a977ba838183b7
MD5 31e921991e2917365af416d757b3d6f5
BLAKE2b-256 9aff49cd6663d7a2dd3bbe183215f8fe5637a1fc3541cdf443e98de3e5b545d2

See more details on using hashes here.

Supported by

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