flexeval.helpers#
Generic utility functions.
Functions
|
Build the display label for a single node in a metric dependency graph. |
Create a random 8-digit id |
|
|
Visualize graphs produced by |
- flexeval.helpers.visualize_graph(graph: DiGraph, ax=None, output_path: str | None = None)[source]#
Visualize graphs produced by
MetricGraphBuilder.- Parameters:
graph (nx.DiGraph) – The graph.
ax (matplotlib.axes.Axes | None, optional) – An existing Axes to draw into. If None, a new figure and axes are created.
output_path (str | None, optional) – If not None, save the figure using
matplotlib.pyplot.Figure.savefig().
- Returns:
The
(fig, ax)the graph was drawn into.- Return type:
- Raises:
ImportError – If matplotlib is not installed.