petab_select.plot
Visualization routines for model selection.
Plotting methods generally take a PlotData object as input, which
can be used to specify information used by multiple plotting methods.
Module Attributes
The font size of axis labels. |
|
The font size of axis tick labels. |
|
The default color of nodes in graph plots. |
Functions
|
Plot all calibrated models and their criterion value. |
|
Plot all calibrated models in the model space, as a directed graph. |
|
Graph the models of each iteration of model selection. |
|
Plot the improvement in criterion across iterations. |
|
Plot criterion values against number of estimated parameters. |
|
Plot an UpSet plot of estimated parameters and criterion. |
Classes
|
Manage data used in plots. |
- petab_select.plot.DEFAULT_NODE_COLOR = 'darkgrey'
The default color of nodes in graph plots.
- petab_select.plot.LABEL_FONTSIZE = 16
The font size of axis labels.
- class petab_select.plot.PlotData(models, criterion=None, relative_criterion=False, labels=None, parameter_labels=None, colors=None)[source]
Manage data used in plots.
- models
The models.
- criterion
The criterion.
- labels
Model labels. Defaults to
petab_select.Model.model_labelorpetab_select.Model.model_idorpetab_select.Model.hash. Keys are model hashes, values are the labels.
- relative_criterion
Whether to display relative criterion values.
- parameter_labels
Labels for parameters. Keys are parameter IDs, values are labels. To use the
parameterNamecolumn of your PEtab parameters table, providepetab_problem.parameter_df["parameterName"].to_dict().
- colors
Colors for each model. Keys are model hashes, values are matplotlib color specifiers ( https://matplotlib.org/stable/users/explain/colors/colors.html ).
- __init__(models, criterion=None, relative_criterion=False, labels=None, parameter_labels=None, colors=None)[source]
- petab_select.plot.TICK_LABEL_FONTSIZE = 12
The font size of axis tick labels.
- petab_select.plot.bar_criterion_vs_models(plot_data, ax=None, bar_kwargs=None)[source]
Plot all calibrated models and their criterion value.
- petab_select.plot.graph_history(plot_data, draw_networkx_kwargs=None, spring_layout_kwargs=None, ax=None)[source]
Plot all calibrated models in the model space, as a directed graph.
- petab_select.plot.graph_iteration_layers(plot_data, ax=None, draw_networkx_kwargs=None, colorbar_mappable=None)[source]
Graph the models of each iteration of model selection.
- Parameters:
plot_data (
PlotData) – The plot data.ax (
Axes) – The axis to use for plotting.draw_networkx_kwargs (
dict[str,Any] |None) – Passed to thenetworkx.draw_networkxcall.colorbar_mappable (
_ScalarMappable) – Customize the colors. See documentation for the mappable argument ofmatplotlib.pyplot.colorbar.
- Return type:
Axes- Returns:
The plot axes.
- petab_select.plot.line_best_by_iteration(plot_data, ax=None)[source]
Plot the improvement in criterion across iterations.
- Parameters:
plot_data (
PlotData) – The plot data.ax (
Axes) – The axis to use for plotting.
- Return type:
Axes- Returns:
The plot axes.
- petab_select.plot.scatter_criterion_vs_n_estimated(plot_data, ax=None, scatter_kwargs=None, max_jitter=0.2)[source]
Plot criterion values against number of estimated parameters.
- Parameters:
plot_data (
PlotData) – The plot data.ax (
Axes) – The axis to use for plotting.scatter_kwargs (
dict[str,str]) – Forwarded tomatplotlib.axes.Axes.scatter.max_jitter (
float) – Add noise to distinguish models with the same number of parameters and similar criterion values. This is a positive value that is the maximal difference to the original value.
- Return type:
Axes- Returns:
The plot axes.