2023-07-30 22:51:17 +00:00
{
2023-07-31 04:33:09 +00:00
"cells": [
{
"cell_type": "code",
"execution_count": 85,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"from pathlib import Path\n",
"import json\n",
"\n",
"def get_last_file_in_directory(directory_path):\n",
" # Get all files in the directory\n",
" files = [f for f in os.listdir(directory_path) if os.path.isfile(os.path.join(directory_path, f))]\n",
"\n",
" # Sort the files by modification time\n",
" files.sort(key=lambda x: os.path.getmtime(os.path.join(directory_path, x)))\n",
"\n",
" # Return the last file in the list\n",
" return files[-1] if files else None\n",
"\n",
"def get_latest_files_in_subdirectories(directory_path):\n",
" latest_files = []\n",
" for subdir in os.scandir(directory_path):\n",
" if subdir.is_dir():\n",
" latest_file = get_last_file_in_directory(subdir.path)\n",
" if latest_file is not None:\n",
" latest_files.append((subdir.path, latest_file))\n",
" return latest_files"
]
},
{
"cell_type": "code",
2023-07-31 11:22:38 +00:00
"execution_count": 13,
2023-07-31 04:33:09 +00:00
"metadata": {},
"outputs": [],
"source": [
"from typing import Optional, Dict, List, Union\n",
"from pydantic import BaseModel, Field\n",
"\n",
"class Metrics(BaseModel):\n",
" difficulty: str\n",
" success: bool\n",
" success_percent: float = Field(..., alias=\"success_%\")\n",
" run_time: Optional[str] = None\n",
" fail_reason: Optional[str] = None\n",
"\n",
"class MetricsOverall(BaseModel):\n",
" run_time: str\n",
" highest_difficulty: str\n",
" percentage: Optional[float] = None\n",
"\n",
"class Test(BaseModel):\n",
" data_path: str\n",
" is_regression: bool\n",
" answer: str\n",
" description: str\n",
" metrics: Metrics\n",
" category: List[str]\n",
" task: Optional[str] = None\n",
" reached_cutoff: Optional[bool] = None\n",
"\n",
"class SuiteTest(BaseModel):\n",
" data_path: str\n",
" metrics: MetricsOverall\n",
" tests: Dict[str, Test]\n",
" category: Optional[List[str]] = None\n",
" task: Optional[str] = None\n",
" reached_cutoff: Optional[bool] = None\n",
"\n",
"class Report(BaseModel):\n",
" command: str\n",
" completion_time: str\n",
" benchmark_start_time: str\n",
" metrics: MetricsOverall\n",
" tests: Dict[str, Union[Test, SuiteTest]]\n",
" config: Dict[str, str]\n"
]
},
{
"cell_type": "code",
"execution_count": 99,
"metadata": {},
"outputs": [
2023-07-30 22:51:17 +00:00
{
2023-07-31 04:33:09 +00:00
"name": "stdout",
"output_type": "stream",
"text": [
"[('c:\\\\Users\\\\silen\\\\Desktop\\\\Untitled Folder\\\\Projects\\\\Auto-GPT\\\\Auto-GPT-Benchmarks\\\\reports\\\\Auto-GPT', 'file55_07-29-10-45.json'), ('c:\\\\Users\\\\silen\\\\Desktop\\\\Untitled Folder\\\\Projects\\\\Auto-GPT\\\\Auto-GPT-Benchmarks\\\\reports\\\\BabyAGI', 'file40_07-29-10-47.json'), ('c:\\\\Users\\\\silen\\\\Desktop\\\\Untitled Folder\\\\Projects\\\\Auto-GPT\\\\Auto-GPT-Benchmarks\\\\reports\\\\beebot', 'file43_07-29-17-22.json'), ('c:\\\\Users\\\\silen\\\\Desktop\\\\Untitled Folder\\\\Projects\\\\Auto-GPT\\\\Auto-GPT-Benchmarks\\\\reports\\\\gpt-engineer', 'file53_07-29-10-45.json'), ('c:\\\\Users\\\\silen\\\\Desktop\\\\Untitled Folder\\\\Projects\\\\Auto-GPT\\\\Auto-GPT-Benchmarks\\\\reports\\\\mini-agi', 'file79_07-29-14-18.json'), ('c:\\\\Users\\\\silen\\\\Desktop\\\\Untitled Folder\\\\Projects\\\\Auto-GPT\\\\Auto-GPT-Benchmarks\\\\reports\\\\smol-developer', 'file54_07-29-10-45.json')]\n",
"Subdirectory: c:\\Users\\silen\\Desktop\\Untitled Folder\\Projects\\Auto-GPT\\Auto-GPT-Benchmarks\\reports\\Auto-GPT, Latest file: file55_07-29-10-45.json\n",
"Subdirectory: c:\\Users\\silen\\Desktop\\Untitled Folder\\Projects\\Auto-GPT\\Auto-GPT-Benchmarks\\reports\\BabyAGI, Latest file: file40_07-29-10-47.json\n",
"Subdirectory: c:\\Users\\silen\\Desktop\\Untitled Folder\\Projects\\Auto-GPT\\Auto-GPT-Benchmarks\\reports\\beebot, Latest file: file43_07-29-17-22.json\n",
"Subdirectory: c:\\Users\\silen\\Desktop\\Untitled Folder\\Projects\\Auto-GPT\\Auto-GPT-Benchmarks\\reports\\gpt-engineer, Latest file: file53_07-29-10-45.json\n",
"Subdirectory: c:\\Users\\silen\\Desktop\\Untitled Folder\\Projects\\Auto-GPT\\Auto-GPT-Benchmarks\\reports\\mini-agi, Latest file: file79_07-29-14-18.json\n",
"Subdirectory: c:\\Users\\silen\\Desktop\\Untitled Folder\\Projects\\Auto-GPT\\Auto-GPT-Benchmarks\\reports\\smol-developer, Latest file: file54_07-29-10-45.json\n"
]
}
],
"source": [
"reports_path = Path.cwd().parent / 'reports'\n",
"\n",
"latest_files = get_latest_files_in_subdirectories(reports_path)\n",
"print(latest_files)\n",
"\n",
"reports_data = {}\n",
"\n",
"# This will print the latest file in each subdirectory and add to the files_data dictionary\n",
"for subdir, file in latest_files:\n",
" subdir_name = os.path.basename(os.path.normpath(subdir))\n",
" print(f\"Subdirectory: {subdir}, Latest file: {file}\")\n",
" if subdir_name not in [\"beebot\", \"mini-agi\"]:\n",
" continue\n",
" with open(Path(subdir) / file, 'r') as f:\n",
" # Load the JSON data from the file\n",
" json_data = json.load(f)\n",
" converted_data = Report.parse_obj(json_data)\n",
" # get the last directory name in the path as key\n",
" reports_data[subdir_name] = converted_data"
]
},
{
"cell_type": "code",
"execution_count": 94,
"metadata": {},
"outputs": [],
"source": [
"STRING_DIFFICULTY_MAP = {\n",
" \"interface\": 1,\n",
" \"basic\": 2,\n",
" \"novice\": 3,\n",
" \"intermediate\": 4,\n",
" \"advanced\": 5,\n",
" \"expert\": 6,\n",
" \"human\": 7,\n",
"}"
]
},
{
"cell_type": "code",
"execution_count": 100,
"metadata": {},
"outputs": [
2023-07-30 22:51:17 +00:00
{
2023-07-31 04:33:09 +00:00
"name": "stdout",
"output_type": "stream",
"text": [
"{'beebot': {'content_gen': 2, 'safety': 4, 'memory': 5, 'code': 5, 'iterate': 5, 'retrieval': 4, 'adaptability': 4}, 'mini-agi': {'content_gen': 2, 'safety': 4, 'memory': 5, 'code': 5, 'iterate': 5, 'retrieval': 4, 'adaptability': 4}}\n"
]
}
],
"source": [
"from typing import Any\n",
"\n",
"def get_agent_category(report: Report) -> dict[str, Any]:\n",
" categories: dict[str, Any] = {}\n",
" \n",
" def get_highest_category_difficulty(data) -> None:\n",
" for category in data.category:\n",
" if category == \"interface\":\n",
" continue\n",
" num_dif = STRING_DIFFICULTY_MAP[data.metrics.difficulty]\n",
" if num_dif > categories.setdefault(category, 0):\n",
" categories[category] = num_dif\n",
"\n",
" for _, test_data in report.tests.items():\n",
" suite = False\n",
"\n",
" if isinstance(test_data, SuiteTest):\n",
" for _, test_data in test_data.tests.items():\n",
" get_highest_category_difficulty(test_data)\n",
" else:\n",
" get_highest_category_difficulty(test_data)\n",
" \n",
" return categories\n",
"\n",
"all_categories: dict[str, Any] = {}\n",
" \n",
"for name, report in reports_data.items():\n",
" categories = get_agent_category(report)\n",
" all_categories[name] = categories\n",
" \n",
"print(all_categories)\n",
" "
]
},
{
"cell_type": "code",
"execution_count": 115,
"metadata": {},
"outputs": [
2023-07-30 22:51:17 +00:00
{
2023-07-31 04:33:09 +00:00
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAk0AAAIUCAYAAAAHexhnAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3xkVfn48c+dPpPJZJJJ73V3k+29F6QsIgiKgIjCigiKgAX9oSKIYgdEwALyVVDEAoqA0kHY3nvPJpu26T2ZXu79/THJZMOWtJnMbPa8X6997b0zt5y0mWfOec5zJEVRFARBEARBEISzUkW7AYIgCIIgCOcCETQJgiAIgiAMgwiaBEEQBEEQhkEETYIgCIIgCMMggi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XExcXR1ZWFr/5zW8GPV9bW8uVV16J2WzGYrFw7bXX0tzcDMCzzz7LD37wA/bu3YskSUiSxLPPPjuyH4YwJBE0CYIgCFGnlbQY1LqI/9NKo+td+tOf/oRGo2Hbtm089thj/PKXv+T//u//ALjjjjvYvHkzf//739m3bx/XXHMNl156KceOHQOgsrKSSy+9lKuvvpp9+/bxj3/8gw0bNnDHHXcMusdDDz3EzJkz2b17N9/+9rf56le/yjvvvAOALMtceeWVdHR0sHbtWt555x2OHz/OddddB8B1113H3XffzdSpU2lsbKSxsTH0nBA+YhkVQRBijlhGZeJxu91UVVVRUFCAwWAIPe70u9nSuReT2ohBrYt
"text/plain": [
"<Figure size 600x600 with 1 Axes>"
2023-07-30 22:51:17 +00:00
]
2023-07-31 04:33:09 +00:00
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"from matplotlib.colors import Normalize\n",
"import matplotlib.patches as mpatches\n",
"import matplotlib.ticker as ticker\n",
"\n",
"\n",
"def save_combined_radar_chart(categories):\n",
"\n",
" labels=np.array(list(next(iter(categories.values())).keys())) # We use the first category to get the keys\n",
" num_vars = len(labels)\n",
" angles = np.linspace(0, 2 * np.pi, num_vars, endpoint=False).tolist()\n",
" angles += angles[:1] # Add the first angle to the end of the list to ensure the polygon is closed\n",
"\n",
" # Create radar chart\n",
" fig, ax = plt.subplots(figsize=(6, 6), subplot_kw=dict(polar=True))\n",
" ax.set_theta_offset(np.pi / 2)\n",
" ax.set_theta_direction(-1)\n",
" ax.spines['polar'].set_visible(False) # Remove border\n",
"\n",
" # Define a custom normalization to start the color from the middle\n",
" norm = Normalize(vmin=0, vmax=max([max(val.values()) for val in categories.values()])) # We use the maximum of all categories for normalization\n",
"\n",
" colors = ['#40c463', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf'] # Define more colors for more categories\n",
"\n",
" for i, (cat_name, cat_values) in enumerate(categories.items()): # Iterating through each category (series)\n",
" values=np.array(list(cat_values.values()))\n",
" values = np.concatenate((values, values[:1])) # Ensure the polygon is closed\n",
"\n",
" ax.fill(angles, values, color=colors[i], alpha=0.25) # Draw the filled polygon\n",
" ax.plot(angles, values, color=colors[i], linewidth=2) # Draw polygon\n",
" ax.plot(angles, values, 'o', color='white', markersize=7, markeredgecolor=colors[i], markeredgewidth=2) # Draw points\n",
"\n",
" # Draw legend\n",
" ax.legend(handles=[mpatches.Patch(color=color, label=cat_name, alpha=0.25) for cat_name, color in zip(categories.keys(), colors)])\n",
"\n",
" lines, labels = plt.thetagrids(np.degrees(angles[:-1]), (list(next(iter(categories.values())).keys()))) # We use the first category to get the keys\n",
"\n",
" # Move labels away from the plot\n",
" for label in labels:\n",
" label.set_position((label.get_position()[0], label.get_position()[1] + -0.05)) # adjust 0.1 as needed\n",
"\n",
" ax.set_rlabel_position(180) # Move radial labels away from the plot\n",
" \n",
" ax.set_yticks([]) # Remove default yticks\n",
"\n",
" # Manually create gridlines\n",
" for y in np.arange(0, norm.vmax + 1, 1):\n",
" if y != norm.vmax:\n",
" ax.plot(angles, [y] * len(angles), color='gray', linewidth=0.5, linestyle=':')\n",
" # Add labels for manually created gridlines\n",
" ax.text(angles[0], y + 0.2, str(int(y)), color='black', size=9, horizontalalignment='center', verticalalignment='center')\n",
"\n",
" plt.show()\n",
"\n",
"# Here is how you can use the function\n",
"categories = {\n",
" 'beebot': {'content_gen': 2, 'safety': 4, 'memory': 1, 'code': 2, 'iterate': 3, 'retrieval': 4, 'adaptability': 3}, \n",
" 'mini-agi': {'content_gen': 4, 'safety': 1, 'memory': 5, 'code': 4, 'iterate': 5, 'retrieval': 4, 'adaptability': 2}\n",
"}\n",
"save_combined_radar_chart(categories)"
]
},
{
"cell_type": "code",
"execution_count": 123,
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import matplotlib.patches as mpatches\n",
"\n",
"def save_single_radar_chart(category_dict: dict[str, int], save_path: str | Path, name: str) -> None:\n",
" labels=np.array(list(category_dict.keys()))\n",
" values=np.array(list(category_dict.values()))\n",
"\n",
" num_vars = len(labels)\n",
"\n",
" angles = np.linspace(0, 2 * np.pi, num_vars, endpoint=False).tolist()\n",
"\n",
" angles += angles[:1]\n",
" values = np.concatenate((values, values[:1]))\n",
"\n",
" colors = ['#40c463']\n",
"\n",
" fig, ax = plt.subplots(figsize=(6, 6), subplot_kw=dict(polar=True))\n",
" ax.set_theta_offset(np.pi / 2)\n",
" ax.set_theta_direction(-1)\n",
"\n",
" ax.spines['polar'].set_visible(False)\n",
"\n",
" lines, labels = plt.thetagrids(np.degrees(angles[:-1]), (list(category_dict.keys())))\n",
"\n",
" for label in labels:\n",
" label.set_position((label.get_position()[0], label.get_position()[1] + -0.05))\n",
"\n",
" ax.fill(angles, values, color=colors[0], alpha=0.25)\n",
" ax.plot(angles, values, color=colors[0], linewidth=2)\n",
"\n",
" for i, (angle, value) in enumerate(zip(angles, values)):\n",
" ha = 'left'\n",
" if angle in {0, np.pi}:\n",
" ha = 'center'\n",
" elif np.pi < angle < 2*np.pi:\n",
" ha = 'right'\n",
" ax.text(angle, value - 0.5, f'{value}', size=10, horizontalalignment=ha, verticalalignment=\"center\", color='black')\n",
"\n",
" ax.set_yticklabels([])\n",
"\n",
" ax.set_yticks([])\n",
"\n",
" for y in np.arange(0, values.max(), 1):\n",
" ax.plot(angles, [y] * len(angles), color='gray', linewidth=0.5, linestyle=':')\n",
"\n",
" for angle, value in zip(angles, values):\n",
" ax.plot(angle, value, 'o', color='white', markersize=7, markeredgecolor=colors[0], markeredgewidth=2)\n",
"\n",
" green_patch = mpatches.Patch(color='#40c463', label='Mini-AGI', alpha=0.25)\n",
" plt.legend(handles=[green_patch])\n",
" \n",
" plt.savefig(f\"{save_path}/{name}.png\", dpi=300) # Save the figure as a PNG file\n",
" plt.close() # Close the figure to free up memory\n",
"\n",
"# Here's how you can use this function:\n",
"categories = {'content_gen': 2, 'safety': 4, 'memory': 5, 'code': 5, 'iterate': 5, 'retrieval': 4, 'adaptability': 4}\n",
"save_single_radar_chart(categories, Path.cwd(), \"test\")"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
2023-07-30 22:51:17 +00:00
{
2023-07-31 04:33:09 +00:00
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAArkAAAIQCAYAAACFTXaSAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAABjWElEQVR4nO3dd3xUVf7/8fckkEkghWJIQk3ooTeVgBQpRppGWWBZNLQAsoAUEYwsJaAGCyKKSlEIICwIIvhTBAEpApEepJcIBDH0ZgIESO7vD7/MOoaSAMMkd17PfdzHgzn33HM+9z7I+uGTc89YDMMwBAAAAJiIm7MDAAAAAB40klwAAACYDkkuAAAATIckFwAAAKZDkgsAAADTIckFAACA6ZDkAgAAwHRIcgEAAGA6JLkAAAAwHZJcAHCSd999V6VLl5a7u7tq1Kjh7HByvMaNG6tx48bODgNALkGSC0CSFBcXJ4vFoi1bttzyfOPGjVWlShWHxrBkyRKNGjXKoXPkFD/88IOGDBmi+vXra/r06Xrrrbfues3q1av1/PPPKzAwUB4eHipSpIjatGmjhQsXZnv+y5cva9SoUVq9evU9RA8AOV8eZwcAADctWbJEH3/8sUskuj/++KPc3Nz0+eefy8PD4679R44cqdGjR6tcuXLq1auXSpUqpbNnz2rJkiVq27atZs+erX/9619Znv/y5cuKiYmRpFxTHf3hhx+cHQKAXIQkFwCc4NSpU/Ly8spSgrtgwQKNHj1a//jHPzRnzhzlzZvXdu7VV1/VsmXLdP36dUeG61SXL19Wvnz5svSsAOAmlisAuC9ffPGFateuLS8vLxUqVEj//Oc/dezYMbs+P/30k9q1a6eSJUvKarWqRIkSGjhwoK5cuWLr06VLF3388ceSJIvFYjsk6ciRI7JYLHrvvff08ccfq3Tp0sqXL5+eeuopHTt2TIZhaMyYMSpevLi8vLz07LPP6ty5c3YxLF68WK1atVLRokVltVpVpkwZjRkzRunp6Xb9bi7L2Lp1q+rVqycvLy+FhIRo0qRJWXoeN27c0JgxY1SmTBlZrVYFBwfr9ddfV1pamq2PxWLR9OnTlZqaarvPuLi42445fPhwFSpUSNOmTbNLcG8KDw9X69atJUnXrl3TiBEjVLt2bfn5+Sl//vxq0KCBVq1aZet/5MgR+fv7S5JiYmJsMfy1gr5v3z794x//UKFCheTp6ak6derom2++yTT3L7/8okaNGsnLy0vFixfXG2+8oenTp8tisejIkSN2fT/55BNVrlxZVqtVRYsWVZ8+fXThwgW7Pn99/g0bNlS+fPn0+uuv2879veqclpamkSNHqmzZsra/W0OGDLF73pK0fPlyPfHEEypQoIC8vb1VoUIF27gAzIlKLgA7Fy9e1JkzZzK136pS+Oabb2r48OFq3769oqKidPr0aX300Udq2LChtm/frgIFCkiS5s+fr8uXL6t3794qXLiwNm3apI8++ki//fab5s+fL0nq1auXfv/9dy1fvlyzZs26ZWyzZ8/WtWvX1K9fP507d07vvPOO2rdvryZNmmj16tUaOnSoDh06pI8++kiDBw/WtGnTbNfGxcXJ29tbgwYNkre3t3788UeNGDFCly5d0rvvvms3z/nz59WyZUu1b99eHTt21JdffqnevXvLw8ND3bp1u+Pzi4qK0owZM/SPf/xDr7zyijZu3KjY2Fjt3btXX3/9tSRp1qxZmjJlijZt2qTPPvtMklSvXr1bjnfw4EHt27dP3bp1k4+Pzx3nlqRLly7ps88+U8eOHdWjRw/98ccf+vzzzxUeHq5NmzapRo0a8vf316effqrevXvrueee0/PPPy9JqlatmiRp9+7dql+/vooVK6bXXntN+fPn15dffqmIiAh99dVXeu655yRJx48f15NPPimLxaLo6Gjlz59fn332maxWa6a4Ro0apZiYGDVr1ky9e/fW/v379emnn2rz5s1av369XfJ+9uxZtWjRQv/85z/1wgsvKCAg4Jb3mpGRoWeeeUbr1q1Tz549FRoaq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LoWjRosqfP79dW/ny5SX9uZ61bt26t4zv6NGjcnNzU9myZe3aAwMDVaBAAR09evSO93crvr6+kv5MzLNqxowZGjdunPbt22e3zCQkJOSu1x46dEiGYWj48OEaPnz4LfucOnVKxYoV09GjRxUWFpbp/N/v/+Z9V6hQwa7dw8NDpUuXzvRcihUrlqWXzA4ePKi9e/fa1hffKk5J6tChgz777DNFRUXptddeU9OmTfX888/rH//4h13SDcBcSHIB3JOMjAxZLBZ9//33cnd3z3Te29tbkpSenq7mzZvr3LlzGjp0qCpWrKj8+fPr+PHj6tKlS7Yqa7ea507thmFIki5cuKBGjRrJ19dXo0ePVpkyZeTp6alt27Zp6NChD7y6d/OFuQehYsWKkqSdO3dmqf8XX3yhLl26KCIiQq+++qqKFCkid3d3xcbGKjEx8a7X33wWgwcPVnh4+C37/D2JfdD+WnW/k4yMDFWtWlXvv//+Lc/f/MePl5eX1q5dq1WrVum7777T0qVLNW/ePDVp0kQ//PDDbf/+AMjdSHIB3JMyZcrIMAyFhITYqpy3snPnTh04cEAzZsxQZGSkrX358uWZ+j7I5PCvVq9erbNnz2rhwoVq2LChrf3w4cO37P/7778rNTXVrpp74MABSVJwcPBt5ylVqpQyMjJ08OBBhYaG2tpPnjypCxcuqFSpUtmOvXz58qpQoYIWL16sCRMm2P7xcDsLFixQ6dKltXDhQrvnOXLkSLt+t3vWpUuXlvRnJb5Zs2Z3nKtUqVI6dOhQpva/t9287/3799vGl/7cCeLw4cN3ned2ypQpox07dqhp06Z3/bvj5uampk2bqmnTpnr//ff11ltvadiwYVq1atU9zw8gZ+P3NADuyfPPPy93d3fFxMTYKqY
"text/plain": [
"<Figure size 800x600 with 2 Axes>"
2023-07-30 22:51:17 +00:00
]
2023-07-31 04:33:09 +00:00
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import pandas as pd\n",
"import seaborn as sns\n",
"import matplotlib.pyplot as plt\n",
"\n",
"# Define data\n",
"categories = {\n",
" 'beebot': {'content_gen': 2, 'safety': 4, 'memory': 1, 'code': 2, 'iterate': 3, 'retrieval': 4, 'adaptability': 3}, \n",
" 'mini-agi': {'content_gen': 4, 'safety': 1, 'memory': 5, 'code': 4, 'iterate': 5, 'retrieval': 4, 'adaptability': 2},\n",
"}\n",
"\n",
"# Convert dictionary to DataFrame\n",
"df = pd.DataFrame(categories)\n",
"\n",
"# Create heatmap\n",
"plt.figure(figsize=(8, 6))\n",
"sns.heatmap(df, annot=True, cmap=\"YlGnBu\", fmt=\"d\", linewidths=.5)\n",
"plt.title('Heatmap of Categories')\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
2023-07-30 22:51:17 +00:00
{
2023-07-31 04:33:09 +00:00
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA0EAAAK4CAYAAACyF/a8AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAABqx0lEQVR4nO3dd3QUZeP28WsT0kijhtCTQGihSJEiD0VAKQoCShPpIiogVQGV9iC9CvgDFKmioAiIgoDShCAiHZVO6CUUE0wiCSTz/sHLPq6hhJBkNsz3c86ew947u3NldxP22pm5x2YYhiEAAAAAsAgXswMAAAAAQEaiBAEAAACwFEoQAAAAAEuhBAEAAACwFEoQAAAAAEuhBAEAAACwFEoQAAAAAEuhBAEAAACwFEoQAAAAAEuhBAFwSuPHj1dISIhcXV31xBNPmB0nU6tdu7ZKly5tdgykQExMjF599VUFBgbKZrOpd+/eZkdKc/PmzZPNZtPOnTvNjgLAwihBAFLkzgeXOxdPT08VK1ZMPXr00KVLl9J0XevWrdM777yj6tWra+7cuRo1alSaPj7Sz40bNzR58mRVqVJF/v7+Du+TI0eOPPTjbdu2TcOGDVNUVFTah3VCo0aN0rx58/TGG29o4cKFateuXbquLygoyOH3+p+XBg0apOu608I777wjm82mVq1amR3lrkaNGq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379nJzc7Nfr1KligzDUOfOnR2Wq1Klis6cOaNbt27Zx/55XFF0dLSuXLmiWrVq6cSJE4q
"text/plain": [
"<Figure size 1000x700 with 1 Axes>"
2023-07-30 22:51:17 +00:00
]
2023-07-31 04:33:09 +00:00
},
"metadata": {},
"output_type": "display_data"
2023-07-30 22:51:17 +00:00
}
2023-07-31 04:33:09 +00:00
],
"source": [
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"\n",
"categories = {\n",
" 'beebot': {'content_gen': 2, 'safety': 4, 'memory': 1, 'code': 2, 'iterate': 3, 'retrieval': 4, 'adaptability': 3}, \n",
" 'mini-agi': {'content_gen': 4, 'safety': 1, 'memory': 5, 'code': 4, 'iterate': 5, 'retrieval': 4, 'adaptability': 2}\n",
" # include other agents here...\n",
"}\n",
"\n",
"# Convert dictionary to DataFrame\n",
"df = pd.DataFrame(categories)\n",
"\n",
"# Create a grouped bar chart\n",
"df.plot(kind='bar', figsize=(10, 7))\n",
"\n",
"plt.title('Performance by Category for Each Agent')\n",
"plt.xlabel('Category')\n",
"plt.ylabel('Performance')\n",
"plt.show()\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
2023-07-30 22:51:17 +00:00
},
2023-07-31 04:33:09 +00:00
"orig_nbformat": 4
},
"nbformat": 4,
"nbformat_minor": 2
2023-07-30 22:51:17 +00:00
}