Skip to content

fit.display

Console output of a parameter fit.

The output of a fit is a sequence of sections which say what is being fitted: the problem, the parameters which are optimized, the settings of the fit, the data it uses and how that data is split into training and validation data. Every section is rendered here, so the fit runner, the command line tools and an interactive session produce the same output.

from sbmlsim.fit import display

display.section("Fit problem 'PK'")
display.key_values({"strategy": "ALL", "runs": 4})

section

section(title, icon=None)

Start a section of the output.

A blank line separates the section from whatever came before it, so the sections are told apart whether the previous one ended in a table or in a key/value block.

Parameters:

Name Type Description Default
title str

title of the section.

required
icon str | None

emoji in front of the title, e.g. ICON_PARAMETERS.

None

key_values

key_values(items)

Print aligned key/value lines, the smallest section of the output.

link(key, path)

Print a file link, on a single line so that the terminal can open it.

The path is a file:// URI, i.e., it has forward slashes and a drive is file:///C:/...; a windows path with backslashes is not a link a terminal opens.

Parameters:

Name Type Description Default
key str

what the link points to, in front of it.

required
path Path | str

path of the file, relative paths are resolved.

required

parameters_table

parameters_table(parameters)

Get the table of the parameters which are optimized.

The target is shown only when some parameter writes an entity of another name, so an ordinary fit does not get a column which repeats its ids.

coverage_table

coverage_table(rows)

Get the table of the simulations every parameter applies to.

A simulation no version of a target reaches keeps the value of the model, which is right where the parameter has no meaning, e.g. an absorption rate on intravenous data; the table makes it a fact which is read and not one which is discovered later. A parameter whose selector matches nothing covers no simulation at all: it stays in the parameter vector without ever changing the model, which is a silent trap for a mistyped filter, so such a row is styled in bold red rather than as an ordinary line.

settings_table

settings_table(settings)

Get the table of the settings of a fit.

data_summary_table

data_summary_table(df)

Get the table of the fit mappings per experiment and kind.

Parameters:

Name Type Description Default
df DataFrame

metadata table of sbmlsim.fit.helpers.MappingSelection.

required

Returns:

Type Description
Table

One row per simulation experiment with the number of mappings of every

Table

kind, and a row with the totals.

data_table

data_table(df)

Get the table of the single fit mappings.

Parameters:

Name Type Description Default
df DataFrame

metadata table of sbmlsim.fit.helpers.MappingSelection.

required

Returns:

Type Description
Table

One row per fit mapping with its experiment, its observable, its kind

Table

and the fields of its metadata, which describe the curve.

print_parameters

print_parameters(parameters, coverage=None)

Print the section of the parameters which are optimized.

Parameters:

Name Type Description Default
parameters Iterable[FitParameter]

parameters of the fit.

required
coverage Sequence[CoverageRow] | None

what every parameter reaches, from sbmlsim.fit.parameter_mapping.ParameterMapping.coverage. The coverage table is only printed when some parameter does not reach every simulation, so an ordinary fit is not given an all-- table.

None

print_settings

print_settings(settings)

Print the section of the settings of a fit.

print_data

print_data(df, detail=True)

Print the section of the data of a fit.

Parameters:

Name Type Description Default
df DataFrame

metadata table of sbmlsim.fit.helpers.MappingSelection.

required
detail bool

list the single fit mappings, not only the counts.

True

print_wide

print_wide(table)

Print a table at its full width, the columns are not truncated.

A table with many columns, e.g. the data table with its metadata, is wider than the console; the console would shorten the cells to , so the table is printed at the width it needs and the terminal wraps the lines.

identifiability_table

identifiability_table(df)

Get the table of a profile likelihood analysis.

Parameters:

Name Type Description Default
df DataFrame

summary of an IdentifiabilityResult, one row per parameter.

required

Returns:

Type Description
Table

The table with the value, the confidence interval and the

Table

classification of every parameter; an open side of an interval is

Table

shown as the bound of the parameter with a < or >.

print_identifiability

print_identifiability(df)

Print the table of a profile likelihood analysis.