nicetoolbox.evaluation.data.plots

Functions

plot_candle_per_group

Generate one candle chart per unique combination of split_by columns.

plot_confusion_matrix_grid

One figure per row in summary: CM heatmap + accuracy/precision/recall/F1 bar chart.

plot_frame_line

Generate per-frame line charts from raw arrays.

plot_pr_curves

Precision-recall curve figure with one line per group.

plot_roc_curves

ROC curve figure with one line per group.

plot_score

Bar chart comparing a scalar score across groups (e.g.

plot_score_grouped

Grouped bar chart comparing a scalar score across x groups, with one color per series.

plot_score_heatmap

Heatmap of scalar scores with x_col on X axis and y_col on Y axis.

nicetoolbox.evaluation.data.plots.plot_candle_per_group(arrays: list[nicetoolbox.evaluation.data.input_loader.LoadedArray], x_col: str, base_title: str, y_label: str, series_col: str | None = None, split_by: GroupBySpec = GroupBySpec(dims=[])) dict[str, matplotlib.figure.Figure][source]

Generate one candle chart per unique combination of split_by columns.

Computes candle statistics (min, q25, median, q75, max) from raw arrays. group_by is derived automatically as split_by + x_col + series_col (if provided).

Returns a dict mapping filename -> figure.

nicetoolbox.evaluation.data.plots.plot_confusion_matrix_grid(summary: DataFrame, group_levels: list[str], base_title: str) dict[str, matplotlib.figure.Figure][source]

One figure per row in summary: CM heatmap + accuracy/precision/recall/F1 bar chart.

Returns a dict mapping filename -> figure.

nicetoolbox.evaluation.data.plots.plot_frame_line(arrays: list[nicetoolbox.evaluation.data.input_loader.LoadedArray], base_title: str, y_label: str, series_col: str | None = None, split_by: GroupBySpec = GroupBySpec(dims=[])) dict[str, matplotlib.figure.Figure][source]

Generate per-frame line charts from raw arrays.

For each split_by group, produces a line chart with frames on X axis and mean metric value (across subjects, cameras, fields) on Y axis. Different series (e.g. algorithms) are shown as separate colored lines.

Returns a dict mapping filename -> figure.

nicetoolbox.evaluation.data.plots.plot_pr_curves(curves: list[tuple[str, numpy.ndarray, numpy.ndarray, float, float]], base_title: str) Figure[source]

Precision-recall curve figure with one line per group.

Each group also gets a dashed horizontal baseline at its positive class prevalence, which is what a random classifier achieves at every threshold.

Parameters:
  • curves – list of (label, recall, precision, ap, prevalence) tuples, one per group row.

  • base_title – figure suptitle.

nicetoolbox.evaluation.data.plots.plot_roc_curves(curves: list[tuple[str, numpy.ndarray, numpy.ndarray, float]], base_title: str) Figure[source]

ROC curve figure with one line per group.

Parameters:
  • curves – list of (label, fpr, tpr, auc) tuples, one per group row.

  • base_title – figure suptitle.

nicetoolbox.evaluation.data.plots.plot_score(df: DataFrame, x_col: str, y_col: str, title: str, x_label: str, y_label: str) Figure[source]

Bar chart comparing a scalar score across groups (e.g. algorithm vs CV).

If multiple rows share the same x_col value, their y_col values are averaged.

nicetoolbox.evaluation.data.plots.plot_score_grouped(df: DataFrame, x_col: str, series_col: str, y_col: str, title: str, x_label: str, y_label: str) Figure[source]

Grouped bar chart comparing a scalar score across x groups, with one color per series.

If multiple rows share the same (x_col, series_col) pair, their y_col values are averaged.

nicetoolbox.evaluation.data.plots.plot_score_heatmap(df: DataFrame, x_col: str, y_col: str, value_col: str, title: str, x_label: str, y_label: str) Figure[source]

Heatmap of scalar scores with x_col on X axis and y_col on Y axis.

If multiple rows share the same (x_col, y_col) pair, their values are averaged. Each cell is annotated with its numeric value.