class documentation

class InferenceResult(loggers.ModelLoggerMixin, models.Model):

View In Hierarchy

Results of an inference run of the lymph-model package.

It fetches the HDF5 parameter samples from the DVC remote storage and uses them to compute the prior risk matrices and stores them in an HDF5 file, too.

Class Meta Undocumented
Static Method fetch_params Load the model parameters from the YAML file in the DVC repo.
Static Method fetch_samples Load the model samples from the HDF5 file in the DVC repo.
Method __str__ Undocumented
Method compute_risk_matrices Compute the risk matrices for the given model and samples.
Method delete Delete the HDF5 file containing the risk matrices.
Method fetch_description Fetch the release description from the GitHub API.
Method get_lymph_model Get (create if necessary) lymph model instance from the stored params.
Method load_risk_matrices Load the precomputed and stored prior risk matrices for the given tumor stage and lateralization.
Method save Compute the risk matrices and store them in the HDF5 file.
Method store_risk_matrices Store the risk matrices in the HDF5 file field on disk.
Class Variable git_repo_name Name of the GitHub repository that contains the trained model.
Class Variable git_repo_owner Owner of the GitHub repository that contains the trained model.
Class Variable num_samples Number of samples to use for computing the prior risk matrices.
Class Variable params_path Path to the YAML file containing the model parameters inside the git repo.
Class Variable revision Git revision of the trained model. E.g., a commit hash, tag, or branch name.
Class Variable risk_matrices HDF5 file containing the computed prior risk matrices.
Instance Variable description GitHub release description of the inference run.
Instance Variable params Parameters to recreate lymph model for risk prediction.
Property git_repo_url Return the URL of the GitHub repository.
Property is_bilateral Return whether the model is bilateral.
Property is_midline Return whether the model is midline.
Property lnls Return a list with the names of the included LNLs.
Property t_stages Return list of tumor stages.
Instance Variable _lymph_model Undocumented
@staticmethod
def fetch_params(dvc_file_system, params_path):

Load the model parameters from the YAML file in the DVC repo.

Parameters
dvc_file_system:DVCFileSystemUndocumented
params_path:Union[Path, str]Undocumented
Returns
Dict[str, Any]Undocumented
@staticmethod
def fetch_samples(dvc_file_system, samples_path, num_samples=100):

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

Parameters
dvc_file_system:DVCFileSystemUndocumented
samples_path:strUndocumented
num_samples:intUndocumented
Returns
np.ndarrayUndocumented
def __str__(self):

Undocumented

def compute_risk_matrices(self, lymph_model, t_stages, samples):

Compute the risk matrices for the given model and samples.

Returns
np.ndarrayUndocumented
def delete(self, *args, **kwargs):

Delete the HDF5 file containing the risk matrices.

def fetch_description(self):

Fetch the release description from the GitHub API.

Returns
strUndocumented
def get_lymph_model(self):

Get (create if necessary) lymph model instance from the stored params.

Returns
Union[Unilateral, Bilateral, MidlineBilateral]Undocumented
def load_risk_matrices(self, t_stage, midline_extension=None):

Load the precomputed and stored prior risk matrices for the given tumor stage and lateralization.

Parameters
t_stage:strUndocumented
midline_extension:Optional[bool]Undocumented
Returns
np.ndarrayUndocumented
def save(self, *args, **kwargs):

Compute the risk matrices and store them in the HDF5 file.

def store_risk_matrices(self, risk_matrices):

Store the risk matrices in the HDF5 file field on disk.

git_repo_name =

Name of the GitHub repository that contains the trained model.

git_repo_owner =

Owner of the GitHub repository that contains the trained model.

num_samples =

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

params_path =

Path to the YAML file containing the model parameters inside the git repo.

revision =

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

risk_matrices =

HDF5 file containing the computed prior risk matrices.

description =

GitHub release description of the inference run.

params =

Parameters to recreate lymph model for risk prediction.

@property
git_repo_url =

Return the URL of the GitHub repository.

@property
is_bilateral =

Return whether the model is bilateral.

@property
is_midline =

Return whether the model is midline.

@property
lnls =

Return a list with the names of the included LNLs.

@property
t_stages =

Return list of tumor stages.

_lymph_model =

Undocumented