Live survival: no options route
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""What a model's production version found about its cohort: `GET /<domain>/modelo/curvas`, `GET /<domain>/modelo/desarrollo` and, over the data ingested so far, `GET /<domain>/modelo/curvas/opciones` and `POST /<domain>/modelo/curvas/consulta`.
|
||||
"""What a model's production version found about its cohort: `GET /<domain>/modelo/curvas`, `GET /<domain>/modelo/desarrollo` and, over the data ingested so far, `POST /<domain>/modelo/curvas/consulta`.
|
||||
|
||||
The population results a training run publishes (`analisis/curvas.json`, `models.cama.survival.population`): the cohort's
|
||||
survival curves and the model's survival at each horizon with its intervals, for the dashboard to draw. They describe the
|
||||
@@ -82,20 +82,6 @@ def model_analysis_blueprint(domain: str, scenario: str) -> Blueprint:
|
||||
"mlflow_run_id": resolved.run_id},
|
||||
"desarrollo": json.loads(content)})
|
||||
|
||||
@blueprint.get("/modelo/curvas/opciones")
|
||||
def live_options():
|
||||
"""What can be selected for the live figure: each covariate's values, the period, the limits and, given
|
||||
`?paciente=<pac_id>`, that patient's own values."""
|
||||
from models.cama.survival import live
|
||||
|
||||
try:
|
||||
_, _, labelled, version = _live_context(domain, scenario)
|
||||
except LookupError as error:
|
||||
return jsonify({"error": f"sin curvas: {error}"}), 404
|
||||
paciente = request.args.get("paciente")
|
||||
found = live.options(labelled, int(paciente) if paciente and paciente.isdigit() else None)
|
||||
return jsonify({"modelo": {"nombre": f"{domain}-{scenario}", "version": str(version)}, "opciones": found})
|
||||
|
||||
@blueprint.post("/modelo/curvas/consulta")
|
||||
def live_curves():
|
||||
"""The figure's record for the selection in the body (`{filtros, periodo}`), scored with the production version over
|
||||
|
||||
Reference in New Issue
Block a user