MCPcopy Index your code
hub / github.com/GPflow/GPflow / metrics_box_plot

Function metrics_box_plot

benchmark/plotters.py:71–93  ·  view source on GitHub ↗

Creates box-plots of metrics.

(
    ax: Axes,
    file_key: Tuple[str, ...],
    column_key: Tuple[str, ...],
    row_key: Tuple[str, ...],
    line_by: GroupingSpec,
    metrics_df: pd.DataFrame,
    metadata: Collection[BenchmarkMetadata],
)

Source from the content-addressed store, hash-verified

69
70@make_plotter
71def metrics_box_plot(
72 ax: Axes,
73 file_key: Tuple[str, ...],
74 column_key: Tuple[str, ...],
75 row_key: Tuple[str, ...],
76 line_by: GroupingSpec,
77 metrics_df: pd.DataFrame,
78 metadata: Collection[BenchmarkMetadata],
79) -> None:
80 """
81 Creates box-plots of metrics.
82 """
83 assert GroupingKey.PLOTTER not in line_by.by
84 metric = _get_metric(metrics_df)
85 labels = []
86 values = []
87 for key, df, _ in group(metrics_df, [], metadata, line_by):
88 labels.append(_join_key(key))
89 values.append(df.value)
90 # cf https://github.com/matplotlib/matplotlib/pull/27901
91 label_id = "tick_labels" if Version(matplotlib.__version__) >= Version("3.9.0") else "labels"
92 ax.boxplot(values, **{label_id: labels}) # type: ignore[arg-type]
93 _shared_ax_config(ax, file_key, column_key, row_key, metric)
94
95
96@make_plotter

Callers

nothing calls this directly

Calls 4

groupFunction · 0.90
_get_metricFunction · 0.85
_join_keyFunction · 0.85
_shared_ax_configFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…