You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(nca): filter mixed-endpoint data + data-driven fallback before defaults
Closes the second class of "Suite-C Phase-1 hits per-fit timeout"
failures (the first class — FOCEI eta-drift on NMID-column data — was
fixed in c721c55). Cause: NCAEstimator was not applying the same
DVID PK-row filter the runner-side adapter uses, so warfarin's
``DVID="cp"`` PK rows + ``DVID="pca"`` PD rows produced terminal-
slope regressions on a mixed-scale population. 25/26 subjects failed
QC, the >50% exclusion gate fired, the estimator fell through to
``_default_estimates()`` (CL=5/V=70/ka=1), and SAEM+FOCEI were
asked to traverse 4 OoMs (literature warfarin CL=0.106) inside the
600s per-fit budget — which they could not.
Two changes:
- ``apmode.data.adapters`` promotes ``_PK_DVID_ALLOWLIST`` to a
public ``PK_DVID_ALLOWLIST`` constant (back-compat alias kept) so
the adapter and the NCA estimator share a single source of truth
for "what counts as a PK observation row". Drift between the two
sets is now structurally impossible.
- ``NCAEstimator.__init__`` filters its observation slice through
``PK_DVID_ALLOWLIST`` when DVID is present (fail-open when DVID
is absent or the filter would empty the frame). On the warfarin
fold02 train subset this recovers per-subject NCA from "25/26
excluded → defaults" to "12/26 excluded → CL=0.17, V=8.5, ka=0.11"
— within 2x of literature on every parameter.
- ``NCAEstimator._apply_fallback`` gains a data-driven layer in front
of ``_default_estimates``. When per-subject NCA still fails QC and
no dataset_card prior is supplied, it derives population estimates
from observed ``Cmax_geomean`` / ``AUC_observed_geomean`` /
``Tmax_geomean`` with log-normal floors/caps ([1,1000] L,
[0.01,500] L/h, [0.05,12] /h). The unit-scale heuristic is
reused so a mg-dose / ng-mL CSV still gets the 1000x correction.
``fallback_source`` cascade is now nca → dataset_card → data_driven
→ defaults; defaults remains as the absolute last resort.
End-to-end:
- Theo + warfarin + mavoglurant nca regression: theo unchanged
(CL=2.97, V=32.6, ka=0.95 vs literature 2.83/32.0/1.5),
warfarin fold02 recovered (was: defaults 5/70/1; now nca
0.17/8.5/0.11; literature 0.106/10.9/0.888).
- 2408 tests pass. Two new test classes pin the contract:
TestNCADVIDFilter (filter recovers NCA on PK+PD synthetic frame;
no-op on DVID-absent frame) and TestDataDrivenFallback (sparse
data triggers data-driven over hard-coded defaults; dataset-card
prior still wins over data-driven).
0 commit comments