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
¶
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. |
None
|
link
¶
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
¶
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
¶
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.
data_summary_table
¶
Get the table of the fit mappings per experiment and kind.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
metadata table of |
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
¶
Get the table of the single fit mappings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
metadata table of |
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 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
|
None
|
print_data
¶
Print the section of the data of a fit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
metadata table of |
required |
detail
|
bool
|
list the single fit mappings, not only the counts. |
True
|
print_wide
¶
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
¶
Get the table of a profile likelihood analysis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
summary of an |
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 |