Every CaCu PIM scenario (cin2_pim, post-colposcopy, post-treatment) and the survival scenario now keep, per
combination of their covariates, the model against its empirical estimate, with the methods each used:
- PIM (models/cacu/cin2_pim/report.py): Turnbull's interval-censored estimate (prevalent = mass at 0, free in (l, r],
unknown baseline in [0, r]; ported from bayes-pim chapter 24) with a bootstrap band, against the mixture refitted on
every coded member with a delta-method band over the likelihood (inverse numerical Hessian, numerical gradient of
CR(t), log scale); E/O at each horizon with log(E/O) taken as normal.
- Survival (models/cacu/survival/report.py): Kaplan-Meier with Greenwood's band against the SEER pipeline's own
subgroup points and bootstrap interval (survival_curves.sv_sub_weights and sv_sub_points, called as they are).
A version keeps the record as analisis/subgrupos.json and a self-contained Plotly page as reportes/subgrupos.html
(TrainingRun.log_report; the saver publishes a dataflow's `reports`). The same drawing is a notebook in the code,
models/cacu/{cin2_pim,survival}/notebooks/reporte_subgrupos.ipynb: chart names and computed results only, a
`parameters` cell, `#| echo: false` cells. models.reports.templates lists those notebooks with the scenarios each serves
and reads one by id, for the WebApi's /governance/notebook-templates. The Jupyter renderer now drops the code of
`#| echo: false` cells, as Quarto does.
plotly>=5.18 joins the `survival-curves` extra (installed by the WebApi) and the dev group.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HmQxVJVNR5FYkPAregGEQ7
models/cama/seer_survival is the SEER survival pipeline as Hamilton dataflows, with the interval LR and network keeping
their per-interval fits and surviving an interval without deaths. models/cama/survival is the scenario: it indexes the
total cohort at the first invasive biopsy report (steps/indexing.py), derives the covariates and the outcome from the
cohort's events, fits the interval survival, writes the five routines and publishes the population curves
(analisis/curvas.json) with the version. An estimate may carry the model's own index date.
Conflicts: the README keeps this branch's rows and adds TEA's; `__main__` keeps the Scenario-based commands and adds
`_own_steps`; pyproject keeps the reports/ paths and adds the `eeg-reference` extra. `GIT_COMMIT_TAG` comes back in
`models.io.lineage` as the name of MLflow's own tag, which `models.tea.eeg.bundle` reads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HmQxVJVNR5FYkPAregGEQ7
They run a notebook on a build's file and keep it as an MLflow run, as eda does; io/ keeps the storage and MLflow
boundary and pipelines/ the cohort pipelines. Moved whole with git mv, imports repointed; models.notebook, the API
notebooks import, stays where it is.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HmQxVJVNR5FYkPAregGEQ7
dev's 1b45bc6 (governance requirements, sandboxed notebooks) was written on the per-scenario driver that this branch
replaced with models.dags; it is carried over in that shape:
- cin2_logistic: the five ML-01a routines (sampling, missing_data, analytic_method, class_balance, output_confidence)
and `routines` are nodes of the scenario's dataflow, on its node names (windowed_outcomes, train_set, test_set,
fitted_pipeline, test_probabilities); `calibration_bins` is a config input with a default.
- io/adapters, dags/training: the saver writes each routine with TrainingRun.log_routine before logging the model;
the driver hands it `routines` when the dataflow has that node. Without it a scenario still trains, but the registry
won't promote it (ROUTINE_KINDS).
- io/tracking: dev's log_routine, run_files and run_file next to this branch's log_model (scikit-learn or pyfunc,
pinned requirements).
- reports/rendering: dev's Quarto and Jupyter renderers (io/rendering.py, followed as a rename) with this branch's
notebook hash; notebook_jobs and experiment import it from there, and cohort_reference and file_sha256 from
io/storage.
- cin2_logistic/train.py: a delegate to models.dags.training for callers of the old driver.
- Persistance's English names from dev: persistance.edges.gold, cohort_repository.
Tests: 219 passed against the monorepo's dev Persistance, Extraction and Core (OCR with tesseract deselected).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HmQxVJVNR5FYkPAregGEQ7
The timeline is cut at the build's clinical and load cut-offs, so the
read can be repeated. Adds apache-hamilton.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>