Skip to content

Commit

Permalink
performance mode plot updated
Browse files Browse the repository at this point in the history
  • Loading branch information
gallg committed Nov 7, 2024
1 parent 6bf60f6 commit 519cf72
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions notebooks/results.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -511,7 +511,7 @@
"source": [
"import numpy as np\n",
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"import seaborn as sns\n",
"import warnings\n",
"import ast\n",
"\n",
Expand Down Expand Up @@ -543,6 +543,9 @@
"# Initialize warnings filter;\n",
"warnings.filterwarnings(\"ignore\")\n",
"\n",
"# Set Seaborn style;\n",
"sns.set(style=\"whitegrid\")\n",
"\n",
"# Prepare the plot;\n",
"fig, ax = plt.subplots(1, 3, figsize=(12, 3))\n",
"\n",
Expand Down Expand Up @@ -573,17 +576,21 @@
" lc_mean = lc_mean[valid_indices]\n",
" lc_std = lc_std[valid_indices]\n",
"\n",
" # Plot the mean learning curve with standard deviation shading;\n",
" ax[i].plot(x_values, lc_mean, c='b', linewidth=1.5)\n",
" ax[i].fill_between(x_values, lc_mean - lc_std, lc_mean + lc_std, edgecolor='b', facecolor='b', alpha=0.1)\n",
" # Plot the mean learning curve with Seaborn's lineplot;\n",
" sns.lineplot(x=x_values, y=lc_mean, ax=ax[i], color='b', linewidth=1.5)\n",
"\n",
" # Add shading (standard deviation) using fill_between;\n",
" ax[i].fill_between(x_values, lc_mean - lc_std, lc_mean + lc_std, color='b', alpha=0.1)\n",
" \n",
" # Add a vertical line at the stopping point;\n",
" ax[i].axvline(x=stop_adj, c='b')\n",
" \n",
" # Dynamically position the text label for the stop point;\n",
" text_x = min(stop_adj, len(lc_mean) - 1)\n",
" ax[i].text(text_x, 0.8, f\"{(stop_adj / len(lc_mean)) * 100:.2f}%\", rotation=0)\n",
" ax[i].text(text_x, 0.8, f\"{(stop_adj / len(lc_mean)) * 100:.2f}%\", rotation=0, color='k')\n",
" \n",
" # Set the subplot title\n",
" ax[i].set_title(f'Performance with MRS = {mrs}')\n",
" ax[i].set_title(f'Performance with $s_{{min}}$ = {mrs}')\n",
"\n",
"# Adjust layout and show plot\n",
"plt.tight_layout()\n",
Expand Down

0 comments on commit 519cf72

Please sign in to comment.