plot_radar_tabresults

Attributes

categories

Functions

plot_radar_chart(→ None)

Generate and save a radar chart to visualize model alignment scores across multiple categories.

Module Contents

plot_radar_tabresults.plot_radar_chart(categories: list[str], model_scores: dict[str, list[float]], title_text: str, output_file: str, model_name: str, art_set: int = 0) None

Generate and save a radar chart to visualize model alignment scores across multiple categories.

This function creates a radar chart to display alignment scores for various model configurations across specified categories. Each model’s scores are transformed using a quantile transformation for comparison, and custom symbols and colors are applied to distinguish between models.

Parameters:
  • categories (list[str]) – List of categories to display on the radar chart (e.g., ‘Humor’, ‘Helpfulness’).

  • model_scores (dict[str, list[float]]) – Dictionary mapping model names to their scores in each category.

  • title_text (str) – Title for the radar chart.

  • output_file (str) – Path for saving the radar chart as a PDF file.

  • model_name (str) – Name of the model to fetch the appropriate file for score transformation.

  • art_set (int, optional) – Specifies the visual style (markers and colors) of the radar chart. Defaults to 0.

Example

>>> categories = ["Humor", "Helpfulness", "Harmlessness", "Diversity", "Coherence", "Perplexity"]
>>> model_scores = {
...     "Original model": [2.07, -1.471, 0.245, 0.876, 0.434, -3.337],
...     "MAP-align to Humor-80%": [2.516, -1.419, 0.012, 0.889, 0.429, -3.205],
...     "MAP-align to Helpfulness-80%": [1.992, -0.754, -0.350, 0.880, 0.427, -3.196]
... }
>>> plot_radar_chart(
...     categories, model_scores,
...     title_text='Model Alignment Comparison',
...     output_file="results/fig_radar_example.pdf",
...     model_name="opt1.3b",
...     art_set=1
... )
plot_radar_tabresults.categories = ['Humor', 'Helpful', 'Harmless', 'Diversity', 'Coherence', 'Perplexity']