-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplot_stats.py
More file actions
30 lines (21 loc) · 747 Bytes
/
plot_stats.py
File metadata and controls
30 lines (21 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from sys import argv
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="whitegrid")
if len(argv) != 2:
print("Usage: python3 plot_stats.py <path_to_csv_file>")
exit(1)
stats_csv_path = argv[1].strip()
stats = pd.read_csv(stats_csv_path)
fig, (ax0, ax1) = plt.subplots(nrows=2, figsize=(6, 5))
ax0.plot(stats["episode"], stats["mean_episode_reward"])
ax0.set_title("Mean episode reward evaluated over 10 episodes")
ax0.set_xlabel("Episode")
ax0.set_ylabel("Mean episode reward")
ax1.plot(stats["episode"], stats["mean_episode_length"])
ax1.set_title("Mean episode length evaluated over 10 episodes")
ax1.set_xlabel("Episode")
ax1.set_ylabel("Mean episode length")
plt.tight_layout()
plt.show()