petab_select.problem
The model selection problem class.
Classes
|
Handle everything related to the model selection problem. |
- class petab_select.problem.Problem(model_space, candidate_space_arguments=None, compare=None, criterion=None, method=None, version=None, yaml_path=None)[source]
Handle everything related to the model selection problem.
- model_space
The model space.
- calibrated_models
Calibrated models. Will be used to augment the model selection problem (e.g. by excluding them from the model space). FIXME(dilpath) refactor out
- candidate_space_arguments
Custom options that are used to construct the candidate space.
- compare
A method that compares models by selection criterion. See
petab_select.model.default_compare()
for an example.
- criterion
The criterion used to compare models.
- method
The method used to search the model space.
- version
The version of the PEtab Select format.
- yaml_path
The location of the selection problem YAML file. Used for relative paths that exist in e.g. the model space files.
TODO should the relative paths be relative to the YAML or the file that contains them?
- __init__(model_space, candidate_space_arguments=None, compare=None, criterion=None, method=None, version=None, yaml_path=None)[source]
- get_best(models, criterion=None, compute_criterion=False)[source]
Get the best model from a collection of models.
The best model is selected based on the selection problem’s criterion.
- Parameters:
models (
Optional
[Iterable
[Model
]]) – The best model will be taken from these models.criterion (
Optional
[str
]) – The criterion by which models will be compared. Defaults toself.criterion
(e.g. as defined in the PEtab Select problem YAML file).compute_criterion (
bool
) – Whether to try computing criterion values, if sufficient information is available (e.g., likelihood and number of parameters, to compute AIC).
- Return type:
- Returns:
The best model.