CaMa survival: the SEER pipeline is imported only when a run develops the model

This commit is contained in:
rockdrigo
2026-11-21 03:33:44 -06:00
parent 9cccec5274
commit f3be09467f
+3 -2
View File
@@ -16,8 +16,6 @@ from pathlib import Path
import numpy as np
import pandas as pd
from models.cama.seer_survival import pipeline
from models.cama.seer_survival.settings import load
UNAVAILABLE = ("Estadio_cat", "Tratamiento_quirurgico_cat", "Radioterapia_cat", "Quimioterapia_cat")
# What the dashboard reads: the file written by a stage, under the name it is published with.
@@ -59,6 +57,8 @@ def _recoded_frame(labelled_members: pd.DataFrame) -> pd.DataFrame:
def _seer_settings(development: dict):
"""The pipeline's own settings with this model's budget (`[config.desarrollo]`) and its Ki-67 column, which the
SEER dictionary does not have."""
from models.cama.seer_survival.settings import load
s = load()
m = s.modeling
modeling = dataclasses.replace(
@@ -84,6 +84,7 @@ def development(labelled_members: pd.DataFrame, desarrollo: dict) -> dict:
"""`{"desarrollo": record}`, or `{}` when `[config.desarrollo]` has `enabled = false`."""
if not desarrollo.get("enabled", True):
return {}
from models.cama.seer_survival import pipeline # the `seer-survival` extra: scoring a member does not need it
errors, log = {}, []
with tempfile.TemporaryDirectory() as tmp:
out = Path(tmp)