sbmlsim.fit.analysis

Analysis of fitting results.

Module Contents

Classes

OptimizationAnalysis

Class for analyzing optimization results.

Attributes

logger

sbmlsim.fit.analysis.logger[source]
class sbmlsim.fit.analysis.OptimizationAnalysis(opt_result, output_name, output_dir, op=None, show_plots=True, show_titles=True, residual=None, loss_function=None, weighting_curves=None, weighting_points=None, variable_step_size=True, absolute_tolerance=1e-06, relative_tolerance=1e-06, image_format='svg', **kwargs)[source]

Class for analyzing optimization results.

Creates all plots and results.

Parameters
run(self, mpl_parameters=None)[source]

Execute complete analysis.

This creates all plots and reports.

Parameters

mpl_parameters (Dict[str, Any]) –

Return type

None

html_report(self, path)[source]

Create HTML report of the fit.

Parameters

path (pathlib.Path) –

_create_mpl_figure(self, width=5.0, height=5.0)[source]

Create matplotlib figure.

Parameters
  • width (float) –

  • height (float) –

Return type

Tuple[matplotlib.figure.Figure, matplotlib.figure.Axes]

_save_mpl_figure(self, fig, path)[source]

Save matplotlib figure to path.

Parameters

path (pathlib.Path) –

Return type

None

plot_fit(self, output_dir, x)[source]

Plot fitted curves with experimental data for given parameter set x.

Creates an overview of all fit mappings.

Parameters
  • output_dir (pathlib.Path) – path to figures

  • x (numpy.ndarray) – parameters to evaluate

Returns

None

Return type

None

plot_fit_residual(self, output_dir, x)[source]

Plot resulting fit for all individual fit mappings.

This consists of - data - prediction - residuals - weighed residuals squared

For better analysis log and linear results are depicted. :param x: parameters to evaluate

Parameters
  • output_dir (pathlib.Path) –

  • x (numpy.ndarray) –

Return type

None

_cost_df(self, x)[source]

Calculate cost dataframe for given parameter set.

Parameters

x (numpy.ndarray) –

Return type

pandas.DataFrame

_datapoints_df(self, x)[source]

Calculate data point dataframe for given parameter set.

Parameters

x (numpy.ndarray) –

Return type

pandas.DataFrame

plot_datapoint_scatter(self, x, path)[source]

Plot cost scatter plot.

Compares cost of model parameters to the given parameter set.

Parameters
  • x (numpy.ndarray) –

  • path (pathlib.Path) –

plot_residual_scatter(self, x, path)[source]

Plot residual plot.

Parameters
  • x (numpy.ndarray) –

  • path (pathlib.Path) –

plot_cost_bar(self, x, path)[source]

Plot cost bar plot.

Compare costs of all curves.

Parameters
  • x (numpy.ndarray) –

  • path (pathlib.Path) –

Return type

None

plot_residual_boxplot(self, x, path)[source]

Plot residual boxplot.

Compare costs of all curves.

Parameters
  • x (numpy.ndarray) –

  • path (pathlib.Path) –

Return type

None

plot_cost_scatter(self, x, path)[source]

Plot cost scatter plot.

Compares cost of model parameters to the given parameter set.

Parameters
  • x (numpy.ndarray) –

  • path (pathlib.Path) –

plot_waterfall(self, path)[source]

Create waterfall plot for the fit results.

Plots the optimization runs sorted by cost.

Parameters

path (pathlib.Path) –

plot_traces(self, path)[source]

Plot optimization traces.

Optimization time course of costs.

Parameters

path (pathlib.Path) –

Return type

None

plot_correlation(self, path)[source]

Plot correlation of parameters for analysis.

Parameters

path (pathlib.Path) –

Return type

None