This example illustrates the code behind the scores_radar_by_task() 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_task() is useful to compare headline metrics from different tasks across multiple models. The data preparation function scales values for visualization purposes by normalizing them using percentile ranks, 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_task_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_task() by using the scores_radar_by_task_df() function. The output of scores_radar_by_task_df() can be directly passed to scores_radar_by_task(). scores_radar_by_task_df() expects an optional list of metric names to invert where lower scores correspond to better scores, an optional list of model names, an optional list of task names, 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_task() specific dataframe.
3
Filter specific models to plot on the radar chart. Each task in the data should have the same set of models.
4
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).
5
Specify an optional domain when using min-max normalization. If unspecified, min-max values are inferred from the data.
6
Add pretty model names and log links to the dataframe using prepare().
7
Provide an optional task name mapping for pretty task names in prepare().