Plots and exports#
mergen.output#
Visualisation and export for SamplingResult.
Plot types#
result.plot(‘pairplot’) — scatter matrix, all parameter pairs result.plot(‘1d’) — marginal KDE + strip per parameter result.plot(‘2d’) — scatter for selected pair(s) result.plot(‘distances’) — pairwise distance distribution result.plot(‘correlation’) — parameter correlation heatmap result.plot(‘quality’) — quality metrics bar chart result.plot(‘all’) — all of the above
Export formats#
result.to_csv(‘design.csv’) result.to_json(‘design.json’) result.to_excel(‘design.xlsx’) result.to_markdown(‘report.md’) result.to_latex(‘report.tex’) result.to_html(‘report.html’)
- All text-based exports (markdown, latex, html) include:
Package banner
Design summary
Parameter space description
Quality metrics
Design points table (per point type, separately)
Validation set table
Extra sets tables
All tabular exports (csv, excel) include all points in a single table with a point_type column for filtering.
- mergen.output.plot_pairplot(result, show_pool=False, title=True, log=None, show=True, save=False, filename=None, fmt=None, dpi=150)[source]#
Scatter matrix of all parameter pairs.
- Parameters:
show_pool (bool — overlay the candidate pool (default False).) – When True, the grid is projected onto each panel and de-duplicated so every candidate is shown once with an equal, density-scaled opacity.
title (bool — show figure title)
log (list of parameter names to display on log scale)
show (bool)
save (bool)
filename (str | None)
fmt (str | None)
options (dpi — output)
dpi (int)
- Return type:
None
- mergen.output.plot_1d(result, params=None, title=True, log=None, show=True, save=False, filename=None, fmt=None, dpi=150)[source]#
Marginal KDE + strip chart for each parameter.
- mergen.output.plot_2d(result, params=None, show_pool=False, title=True, log=None, show=True, save=False, filename=None, fmt=None, dpi=150)[source]#
Scatter plot for selected parameter pair(s).
- mergen.output.plot_distances(result, title=True, show=True, save=False, filename=None, fmt=None, dpi=150)[source]#
Pairwise distance distribution for all sets.
- mergen.output.plot_correlation(result, title=True, show=True, save=False, filename=None, fmt=None, dpi=150)[source]#
Parameter correlation heatmap for the design points.
Shows absolute pairwise correlations between all parameters. Values close to 0 indicate good orthogonality.
- mergen.output.plot_quality(result, title=True, show=True, save=False, filename=None, fmt=None, dpi=150)[source]#
Quality metrics bar chart.
All default metrics are drawn as horizontal bars on a single axis that auto-ranges to the data, so a small value is still visible rather than collapsing to nothing. Each bar shows the true metric value (annotated with the value and its percentile rank); the dashed vertical marker on each bar is that metric’s Monte Carlo baseline (the median over random designs). Bars are coloured green (good) to red (poor) by percentile rank against that baseline. Metrics are on different scales, so bar lengths are meaningful per metric (versus its own baseline), not for comparing one metric against another.
- mergen.output.plot_comparison(result, title=True, show=True, save=False, filename=None, fmt=None, dpi=150)[source]#
Bar chart comparing the criterion score of each optimisation algorithm.
Only meaningful when
Sampler.run()was called withalgorithm=[...]. The best (lowest-scoring) algorithm is highlighted; bar heights show the raw criterion value, lower is better. Elapsed time is annotated above each bar.- Parameters:
result (SamplingResult) – Must contain at least one entry in
result.algorithm_results.title (bool) – Standard plotting controls (see other
plot_*functions).show (bool) – Standard plotting controls (see other
plot_*functions).save (bool) – Standard plotting controls (see other
plot_*functions).filename (str | None) – Standard plotting controls (see other
plot_*functions).fmt (str | None) – Standard plotting controls (see other
plot_*functions).dpi (int) – Standard plotting controls (see other
plot_*functions).
- Raises:
ValueError – If no algorithm results are present.
- Return type:
None
- mergen.output.plot_comparison_matrix(comparison, title=True, show=True, save=False, filename=None, fmt=None, dpi=150)[source]#
Heat map of a ComparisonResult’s percentile-rank table.
Rows are (criterion, algorithm) combinations, columns are the quality metrics, and the cell colour encodes the percentile rank (green good, red poor) against the shared Monte Carlo baseline. The winning combination’s row label is marked with a star.
- mergen.output.plot_all(result, show_pool=False, title=True, log=None, show=True, save=False, fmt=None, dpi=150)[source]#
Produce all standard plots.
- mergen.output.plot(result, kind='pairplot', **kwargs)[source]#
Visualise the design.
- Parameters:
kind (str) –
Plot type. One of:
'pairplot': scatter matrix, all parameter pairs'1d': marginal KDE + strip per parameter'2d': scatter for selected pair(s)'distances': pairwise distance distribution'correlation': parameter correlation heatmap'quality': quality metrics bar chart'comparison': bar chart of per-algorithm scores (only when multiple algorithms were run)'all': all of the above
**kwargs – show_pool, title, log, params, show, save, filename, fmt, dpi
- Return type:
None
- mergen.output.export_csv(result, filename='design.csv')[source]#
Save all points to CSV (single table, point_type column).
- Parameters:
filename (str)
- Return type:
None
- mergen.output.export_json(result, filename='design.json')[source]#
Save all points to JSON (single table).
- Parameters:
filename (str)
- Return type:
None
- mergen.output.export_excel(result, filename='design.xlsx')[source]#
Save to Excel — single sheet with all points and point_type column. Columns are auto-sized and header row is formatted.
- Parameters:
filename (str)
- Return type:
None
- mergen.output.export_markdown(result, filename='report.md')[source]#
Save a full Markdown report: banner → metadata → parameter space → design summary → run settings → quality metrics → design tables.
- Parameters:
filename (str)
- Return type:
None