This example illustrates the code behind the scores_radar_by_metric() pre‑built view function. If you want to include this plot in your notebooks or sites, start with that function rather than the lower‑level code below.
scores_radar_by_metric() is useful to compare scores across multiple models and metrics from a single task with composite metrics. The data preparation function scales values for visualization purposes by normalizing them using percentile ranks or min-max normalization, the raw values are displayed in the tooltips.
Load data from a Parquet file into an inspect_viz.Data table.
2
Channels provide readable names for tooltips and the log viewer.
3
Coordinates: compute coordinates for axes, grid circles, and labels.
4
Selection enables interactive hovering/clicking to emphasize a single model.
5
Grid lines line() mark draws grid circles.
6
Axes spokes line() mark draws axes.
7
Polygon outlines line() mark draws polygon outlines.
8
Polygon vertex markers circle() mark draws polygon vertex markers.
9
Axis labels text() mark draws axis labels.
10
Layout draws the plot with no axes since axes are arbitrary scalers in the radar chart.
11
Legend draws a legend for the model selection.
Data Preparation
The data dataset for this example was created using the scores_radar_by_metric_df() function, which reads evals metadata, scales scores by percentile ranks or min-max normalization, and computes coordinates for the radar chart.
Above we read the data for the plot from a parquet file. This file was in turn created by:
Reading evals level data into a data frame with evals_df().
Converting the evals dataframe into a dataframe specifically used by scores_radar_by_metric() by using the scores_radar_by_metric_df() function. The output of scores_radar_by_metric_df() can be directly passed to scores_radar_by_metric(). scores_radar_by_metric_df() expects a scorer name, an optional list of metric names to visualize, an optional list of metric names to invert where lower scores correspond to better scores, an optional normalization method to scale scores, and an optional min-max domain to use for normalization on the radar chart.
Convert the dataframe into a scores_radar_by_metric() specific dataframe.
3
A task might have multiple scorers, specify the scorer which you want to plot. The function only supports plotting one scorer at a time. The scorer name should correspond to columns in df named score_{scorer}_{metric}.
4
Specify a list of metrics to plot on the radar chart. If unspecified, all metrics from a scorer will be plotted. Metric names in the list should correspond to columns in df named score_{scorer}_{metric}.
5
Choose an optional normalization method to scale the raw scores. Available options: "percentile" (computes percentile rank, useful for identifying consistently strong performers), "min_max" (scales scores between min-max values, sensitive to outliers), or "absolute" (default, no normalization, may result in incomprehensible charts if metrics have different scales).
6
Add pretty model names and log links to the dataframe using prepare().