module documentation
Models for the riskpredictor
Django app.
The model CheckpointModel
holds an upload of parameter samples that were produced
during an inference run of the lymph-model. The samples should be fetched from the
DVC remote storage and used to compute the prior risk matrices.
Given a specific diagnosis, as entered via the forms.RiskpredictorForm
, the
lymph-model package and the precomputed risk matrices in the CheckpointModel
instances, the personalized risk estimates can be computed.
Class |
|
Results of a round of parameter sampling for one of the lymph.models . |
Function | cached |
Compute the prior state dists for the given model, samples, and t_stage. |
Function | cached |
Construct the lymph model and add the distributions to it. |
Function | cached |
Fetch and merge the YAML configuration files from the repo. |
Function | cached |
Fetch the model samples from the HDF5 file in the DVC repo. |
Function | validate |
Validate the pydantic configs necessary for constructing the model. |
Type Alias |
|
Undocumented |
Variable | logger |
Undocumented |
Variable | memory |
Undocumented |
@memory.cache
def cached_compute_priors(model:
def cached_compute_priors(model:
Model
, samples: np.ndarray
, t_stage: str | int
) -> np.ndarray
:
¶
Compute the prior state dists for the given model, samples, and t_stage.
@memory.cache
def cached_construct_model_and_add_dists(graph_config:
def cached_construct_model_and_add_dists(graph_config:
GraphConfig
, model_config: ModelConfig
, dist_configs: dict[ str | int, DistributionConfig]
, version: int
) -> Model
:
¶
Construct the lymph model and add the distributions to it.
@memory.cache
def cached_fetch_and_merge_yaml(repo_name:
def cached_fetch_and_merge_yaml(repo_name:
str
, ref: str
, graph_config_path: str
, model_config_path: str
, dist_configs_path: str
) -> dict[ str, Any]
:
¶
Fetch and merge the YAML configuration files from the repo.
@memory.cache
def cached_fetch_model_samples(repo_name:
def cached_fetch_model_samples(repo_name:
str
, ref: str
, samples_path: str
, num_samples: int
, seed: int
= 42) -> np.ndarray
:
¶
Fetch the model samples from the HDF5 file in the DVC repo.
ConfigAndVersionTupleType =
¶
Undocumented
Value |
|