From f9d97f4d12fd3c9b5957f55aabddf98710103fea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Trevi=C3=B1o=20Cervantes?= Date: Mon, 23 Nov 2026 00:14:14 -0600 Subject: [PATCH] Scenarios: batch_estimates turns off the cycle's per-member scoring; off for CaMa recurrence, answered per clinical scenario --- models/cama/recurrence/model.toml | 2 ++ models/dags/training.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/models/cama/recurrence/model.toml b/models/cama/recurrence/model.toml index b3f549d..761feea 100644 --- a/models/cama/recurrence/model.toml +++ b/models/cama/recurrence/model.toml @@ -11,6 +11,8 @@ Análisis de recurrencia: probabilidad de que la enfermedad regrese a los 12, 36 regresión logística y una red bayesiana por horizonte, entrenadas con las pacientes cargadas de dos cohortes externas (METABRIC y SCAN-B). Pendiente \ de validación clínica.""" requirements = ["pandas", "numpy", "scipy", "scikit-learn", "statsmodels", "pgmpy", "lifelines", "mpmath"] +# Its figures are answered per clinical scenario (`/cama/modelo/recurrencia`); the cycle does not score each member. +batch_estimates = false [config.recurrence] horizons = [12, 36, 60] # months diff --git a/models/dags/training.py b/models/dags/training.py index a4052c5..4b6d488 100644 --- a/models/dags/training.py +++ b/models/dags/training.py @@ -52,6 +52,9 @@ class Scenario: # What the model's number is (`[estimand]`): `quantity`, `description`, `outcome`, `index_date`, `horizons_unit`; # what a screen shows next to each risk. How its interval is computed is the version's report's, not the screen's. estimand: dict = field(default_factory=dict) + # Whether the cycle scores every member of the cohort with the version in production (`batch_estimates`); off for a + # model whose answers are per clinical scenario, not a risk per member. + batch_estimates: bool = True @classmethod def from_toml(cls, path: str | Path) -> "Scenario": @@ -62,7 +65,7 @@ class Scenario: modules=tuple(import_module(name) for name in found["modules"]), config=found["config"], folder=path.parent, requirements=tuple(found.get("requirements", ())), tables={name: found[name] for name in found.get("settings_tables", ())} or None, - estimand=dict(found.get("estimand", {}))) + estimand=dict(found.get("estimand", {})), batch_estimates=bool(found.get("batch_estimates", True))) @classmethod def load(cls, domain: str, scenario: str) -> "Scenario":