410de1d3b7
models/steps/indexing.py: a scenario that lists it gets its source cohort as `source_cohort`, and the node `cohort` re-indexes it by `[config.index]` of its model.toml: the surveillance kind (first cytology) and the post-colposcopy kind (visit k), with dbt's rules in dbt's order and names, the recruitment window taken from the source cohort's parameters. Every kind ends with `observacion_previa_insuficiente`, a threshold on the days observed before the index (0 for now: the data are left-truncated, so rules on earlier events read only what was recorded). On the synthetic copy the pipeline gives dbt's patients, index dates and attrition for cin2_pim and cin2_logistic (surveillance) and cin2_pim_post_colposcopy (visit 1, now on cacu/cohorte_total). cin2_logistic's MUESTREO records the index attrition and the prior history; a stored build's lineage carries its parameters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HmQxVJVNR5FYkPAregGEQ7
33 lines
1.8 KiB
TOML
33 lines
1.8 KiB
TOML
domain = "cacu"
|
|
scenario = "cin2_logistic"
|
|
cohort = "cacu/cohorte_vigilancia"
|
|
outcome = "cin2_12m"
|
|
# What a registered version needs to load and predict, pinned to the installed versions when it's logged.
|
|
requirements = ["scikit-learn", "numpy", "pandas", "scipy", "cloudpickle"]
|
|
# The modules whose functions are the graph's nodes, in `with_modules`.
|
|
modules = ["models.cacu.cin2_logistic.model", "models.steps.model_fitting", "models.steps.indexing"]
|
|
description = """
|
|
Prototipo: probabilidad de CIN2+ (biopsia LIEAG, CIS o carcinoma) en los 12 meses siguientes a la citología índice, \
|
|
a partir de los resultados de esa muestra (Bethesda, VPH, VPH 16/18). La ventana es provisional y el modelo no tiene \
|
|
validación clínica."""
|
|
|
|
# The dataflow's config (`with_config`); each key is an input of the nodes that name it.
|
|
[config]
|
|
classifier = "logistic"
|
|
train_fraction = 0.7
|
|
predictor_columns = ["bethesda", "vph", "vph_16_18"]
|
|
# Provisional, to be decided with the domain expert: the window, in years, in which a CIN2+ biopsy counts as the
|
|
# outcome; the model's one horizon. On the DEV simulated data (cut-off 2026-12-31, index dates from late 2024) a 2-year
|
|
# window leaves no member with a complete window; 1 year leaves 5,231 known members, 162 with the event.
|
|
horizons_years = [1.0]
|
|
event_grades = ["LIEAG", "CIS", "CARCINOMA"]
|
|
|
|
# The scenario's index and rules, over its source cohort (models/steps/indexing.py): the same as dbt's surveillance
|
|
# cohort, applied in the pipeline. The recruitment window is the source cohort's.
|
|
[config.index]
|
|
kind = "primera_citologia"
|
|
event_grades = ["LIEAG", "CIS", "CARCINOMA"]
|
|
|
|
# PROVISIONAL (sin_definir): the data are left-truncated, so rules on earlier events read only what was recorded;
|
|
# 0 keeps everyone. Raise it once the population starts with enough history (S-CPS-20).
|
|
observacion_previa_minima_dias = 0 |