petab_select.ui
Functions
|
Finalize model selection iteration. |
|
Get the best model from a list of models. |
|
Generate the PEtab problem for a model. |
|
Generate the PEtab problems for a list of models. |
|
Search the model space for candidate models. |
|
Get the state after starting the iteration. |
|
- petab_select.ui.end_iteration(problem, candidate_space, calibrated_models)[source]
Finalize model selection iteration.
All models from the current iteration are provided to the calibration tool. This includes user-calibrated models that the tool did not see until now.
A termination signal is also provided, if the model selection algorithm ends.
- Parameters:
problem (
Problem) – The PEtab Select problem.candidate_space (
CandidateSpace) – The candidate space.calibrated_models (
Models) – The calibration results for the uncalibrated models of this iteration.
- Returns:
petab_select.constants.MODELS:All calibrated models for the current iteration.
petab_select.constants.TERMINATE:Whether PEtab Select has decided to end the model selection, as a boolean.
- Return type:
A dictionary, with the following items
- petab_select.ui.get_best(problem, models, criterion=None)[source]
Get the best model from a list of models.
- petab_select.ui.model_to_petab(model, output_path=None)[source]
Generate the PEtab problem for a model.
- petab_select.ui.models_to_petab(models, output_path_prefix=None)[source]
Generate the PEtab problems for a list of models.
- Parameters:
- Return type:
- Returns:
The PEtab problems, and the paths to the PEtab problem YAML files, if an output path prefix is provided.
- petab_select.ui.start_iteration(problem, candidate_space=None, limit=inf, limit_sent=inf, excluded_hashes=None, criterion=None, user_calibrated_models=None)[source]
Search the model space for candidate models.
The predecessor model can be specified in the candidate_space (
CandidateSpace.set_predecessor_model). If `candidate_space()is not provided, then the predecessor model can be specified in problem (Problem.candidate_space_arguments).- Parameters:
problem (
Problem) – A PEtab Select problem.candidate_space (
CandidateSpace|None) – The candidate space. Defaults to a new candidate space based on the method defined in the problem.limit (
float|int) – The maximum number of models to add to the candidate space.limit_sent (
float|int) – The maximum number of models sent to the candidate space (which are possibly rejected and excluded).excluded_hashes (
list[ModelHash] |None) – Hashes of models that will be excluded from the candidate space.criterion (
Criterion|None) – The criterion by which models will be compared. Defaults to the criterion defined in the PEtab Select problem.user_calibrated_models (
Models|None) – Models that were already calibrated by the user. If a model in the candidates has the same hash as a model in user_calibrated_models, then the candidate will be replaced with the calibrated version. Calibration tools will only receive uncalibrated models from this method.
- Returns:
petab_select.constants.CANDIDATE_SPACE:The candidate space.
petab_select.constants.MODELS:The uncalibrated models of the current iteration.
- Return type:
A dictionary, with the following items