Figures (mtb.plot)¶
Draw figures from a long results table: mtb.load_results returns one for
the stored results, mtb.evaluate and RunResult.long for your own runs.
| Name | Summary |
|---|---|
mtb.plot.bubble |
Draw the paper's bubble table: methods as rows, metrics as columns. |
mtb.plot.bar |
Draw each method's overall score as a horizontal bar, best on top. |
mtb.plot.bubble
¶
Draw the paper's bubble table: methods as rows, metrics as columns.
Metrics are grouped into families, each led by an Overall bar. Rows run
best first, in the order of mtb.rank(category, long_df=long_df,
metrics=...) with the same metrics.
| PARAMETERS | DESCRIPTION |
|---|---|
long_df
|
A long table (
type
|
metrics
|
A family (
type
|
methods
|
Methods (rows) to show;
type
|
title
|
Figure title;
type
|
save
|
File to write the figure to; the suffix picks the format (
type
|
| RETURNS | DESCRIPTION |
|---|---|
Figure
|
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
|
| WARNS | DESCRIPTION |
|---|---|
UserWarning
|
|
Examples
mtb.plot.bar
¶
bar(
long_df: DataFrame,
*,
metrics=None,
methods=None,
title: str | None = None,
save: str | None = None,
)
Draw each method's overall score as a horizontal bar, best on top.
Within each dataset the methods are ranked on each metric; the bar is the
across-dataset score, in the order of mtb.rank(category,
long_df=long_df, metrics=...) with the same metrics.
| PARAMETERS | DESCRIPTION |
|---|---|
long_df
|
A long table (
type
|
metrics
|
A family (
type
|
methods
|
Methods (bars) to show, ranked among themselves;
type
|
title
|
Figure title;
type
|
save
|
File to write the figure to.
type
|
| RETURNS | DESCRIPTION |
|---|---|
Figure
|
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
|
| WARNS | DESCRIPTION |
|---|---|
UserWarning
|
A method missing from some datasets, a dataset with one method, a metric only one method has, or rows scored before 0.4.0. |
Examples