From ccdfe06261be73dab21daa843aa9d6436ac458d3 Mon Sep 17 00:00:00 2001 From: edgar Date: Fri, 4 Dec 2026 12:47:07 -0600 Subject: [PATCH] Dejar sin entrenar ni puntuar los modelos ocultos y preparar los de CIN 3+ --- models/cacu/specs.py | 7 +++++++ models/jobs.py | 9 +++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/models/cacu/specs.py b/models/cacu/specs.py index b0f5767..3df422b 100644 --- a/models/cacu/specs.py +++ b/models/cacu/specs.py @@ -215,6 +215,13 @@ MODELS = { incidence_features=("cytology", "hpv_positive"), history=_REFERRAL), Pim("cin2_pim_post_treatment", "cacu_cohort_post_treatment", cacu.CIN2_PLUS, cacu.KPNC_3, strata=(), incidence_features=("cytology", "hpv_positive")), + # Hidden (core.models.HIDDEN): CIN3+ needs biopsies graded apart from CIN2. + Pim("cin3_pim", "cacu_cohort_surveillance", cacu.CIN3_PLUS, cacu.KPNC, + strata=("hpv_positive",), incidence_features=("cytology",), + predict_at="last_screening_cytology"), + Pim("cin3_pim_post_colposcopy", "cacu_cohort_post_colposcopy", cacu.CIN3_PLUS, + cacu.KPNC_3, strata=("referral_grade",), + incidence_features=("cytology", "hpv_positive"), history=_REFERRAL), Logistic("cin2_logistic", "cacu_cohort_surveillance", cacu.CIN2_PLUS), Spec("survival", "cacu_cohort_survival", ("age_group", "cytology", "hpv"), survival_covariates, borders=(0, 12, 36, 60), cap_months=60, diff --git a/models/jobs.py b/models/jobs.py index cc65243..60193fa 100644 --- a/models/jobs.py +++ b/models/jobs.py @@ -11,6 +11,7 @@ import mlflow.pyfunc import pandas as pd from joblib.externals.loky import get_reusable_executor +from core.cacu import visibility from persistance import gold, registry @@ -43,12 +44,12 @@ class Jobs: return f"{self.domain}_events" def routine(self) -> list[str]: - """The models a train run takes when none is named: all of them.""" - return list(self.models) + """The models a train run takes when none is named: all but the hidden ones.""" + return [n for n in self.models if visibility.model(self.registered(n))] def scored(self) -> list[str]: - """The models a score run takes when none is named: all of them.""" - return list(self.models) + """The models a score run takes when none is named: all but the hidden ones.""" + return self.routine() def registered(self, name: str) -> str: return f"{self.domain}.{name}"