pypesto.select.postprocessors
Process a model selection ModelProblem
after calibration.
Functions
|
Change a PEtab Select model ID to a binary string. |
|
Combine multiple postprocessors into a single postprocessor. |
|
Create a TSV table of model selection results. |
|
Save the parameter estimation result. |
|
Produce a waterfall plot. |
- pypesto.select.postprocessors.model_id_binary_postprocessor(problem)[source]
Change a PEtab Select model ID to a binary string.
Changes the model ID in-place to be a string like
M_ijk
, wherei
,j
,k
, etc. are1
if the parameter in that position is estimated, or0
if the parameter is fixed.To ensure that other postprocessors (e.g.
report_postprocessor()
) use this new model ID, when in use with amulti_postprocessor()
, ensure this is before the other postprocessors in thepostprocessors
argument ofmulti_postprocessor()
.- Parameters:
problem (
ModelProblem
) – A model selectionModelProblem
that has been optimized.
- pypesto.select.postprocessors.multi_postprocessor(problem, postprocessors=None)[source]
Combine multiple postprocessors into a single postprocessor.
See
save_postprocessor()
for usage hints.- Parameters:
problem (
ModelProblem
) – A model selectionModelProblem
that has been optimized.postprocessors (
list
[Callable
[[ModelProblem
],None
]]) – A list of postprocessors, which will be sequentially applied to the optimized modelproblem
. The location where results will be stored.
- pypesto.select.postprocessors.report_postprocessor(problem, output_filepath, criteria=None)[source]
Create a TSV table of model selection results.
- Parameters:
problem (
ModelProblem
) – A model selectionModelProblem
that has been optimized.output_filepath (
str
|Path
) – The file path where the report will be saved.criteria (
list
[Criterion
]) – The criteria that will be in the report. Defaults to nllh, AIC, AICc, and BIC.
- pypesto.select.postprocessors.save_postprocessor(problem, output_path='.', use_model_hash=False)[source]
Save the parameter estimation result.
When used, first set the output folder for results, e.g. with
functools.partial()
. This is because postprocessors should take only a single parameter: an optimized model.from functools import partial output_path = 'results' pp = partial(save_postprocessor, output_path=output_path) selector = pypesto.select.ModelSelector( problem=problem, model_postprocessor=pp, )
- Parameters:
problem (
ModelProblem
) – A model selectionModelProblem
that has been optimized.output_path (
str
|Path
) – The location where output will be stored.use_model_hash (
bool
) – Whether the filename should use the model hash. Defaults toFalse
, in which case the model ID is used instead.
- pypesto.select.postprocessors.waterfall_plot_postprocessor(problem, output_path='.')[source]
Produce a waterfall plot.
See
save_postprocessor()
for usage hints and argument documentation.- Parameters:
problem (ModelProblem)