class documentation

Results of a round of parameter sampling for one of the lymph.models.

In this database model, one can specify where (i.e., in which remote repositories) to look for YAML files that define a model via the lyscripts.configs. The validate_configs method is used to validate these YAML configs.

It also allows to fetch_samples (which are typically not stored in the repository, but are referenced by DVC to be found in a remote storage) and can precompute_priors for all T-stages and a subset of the samples.

Much of what this class sets up and precomputes is cached using joblib for faster computation of the actual risks later on.

Class Meta Meta options for the CheckpointModel.
Method __str__ Return the string representation of the instance.
Method compute_priors Compute priors for every T-stage using the model samples.
Method construct_model Create one of the lymph.models as specified in the validated configs.
Method fetch_samples Fetch the model samples from the HDF5 file in the DVC repo.
Method get_merged_yaml Fetch and merge the YAML configuration files from the repo.
Method precompute_priors Precompute the priors for all T-stages and cache them using joblib.
Method save Fill the cache with precomputed priors before saving the instance.
Method validate_configs Validate the pydantic configs necessary for constructing the model.
Class Variable dist_configs_path Path to YAML file defining a DistributionConfig for each T-stage.
Class Variable graph_config_path Path to YAML file containing the GraphConfig inside the git repo.
Class Variable model_config_path Path to YAML file containing the ModelConfig inside the git repo.
Class Variable num_samples Number of samples to use for computing the prior risk matrices.
Class Variable ref Git reference of the trained model. E.g., a commit hash, tag, or branch name.
Class Variable repo_name Identifier of the GitHub repository that contains the trained model.
Class Variable samples_path Path to HDF5 file containing the parameter samples inside the git repo.
Property is_midline Check if the model is a Midline model.
Property is_unilateral Check if the model is a Unilateral model.
def __str__(self) -> str:

Return the string representation of the instance.

def compute_priors(self, t_stage: int | str) -> np.ndarray:

Compute priors for every T-stage using the model samples.

def construct_model(self) -> Model:

Create one of the lymph.models as specified in the validated configs.

def fetch_samples(self) -> np.ndarray:

Fetch the model samples from the HDF5 file in the DVC repo.

def get_merged_yaml(self) -> dict[str, Any]:

Fetch and merge the YAML configuration files from the repo.

def precompute_priors(self):

Precompute the priors for all T-stages and cache them using joblib.

def save(self, *args: Any, **kwargs: Any):

Fill the cache with precomputed priors before saving the instance.

def validate_configs(self) -> ConfigAndVersionTupleType:

Validate the pydantic configs necessary for constructing the model.

dist_configs_path =

Path to YAML file defining a DistributionConfig for each T-stage.

graph_config_path =

Path to YAML file containing the GraphConfig inside the git repo.

model_config_path =

Path to YAML file containing the ModelConfig inside the git repo.

num_samples =

Number of samples to use for computing the prior risk matrices.

ref =

Git reference of the trained model. E.g., a commit hash, tag, or branch name.

repo_name =

Identifier of the GitHub repository that contains the trained model.

samples_path =

Path to HDF5 file containing the parameter samples inside the git repo.

@property
is_midline: bool =

Check if the model is a Midline model.

@property
is_unilateral: bool =

Check if the model is a Unilateral model.