-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrecord_analysis.py
45 lines (40 loc) · 1.31 KB
/
record_analysis.py
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
RECORD = "records/record.txt"
df = pd.read_csv(RECORD, names=['model', 'timestamp', 'reward', 'time',
'steps', 'avg_q_max', 'avg_loss'])
df['timestamp'] = pd.to_datetime(df['time'],unit='s')
print(df.head())
# df.plot(y='avg_q_max', use_index=True)
xaxis = ['index']
# yaxis = ['reward', 'time', 'steps', 'avg_q_max', 'avg_loss']
yaxis = ['steps', 'avg_q_max', 'avg_loss']
for x in xaxis:
for y in yaxis:
fig, ax = plt.subplots(nrows=1, ncols=1)
fig.suptitle(y)
ax.set_ylabel(y)
ax.axhline(0, color='black')
df.reset_index().plot.scatter(x=x, y=y, ax=ax)
# ax.set_xlim(xmin=8000)
plt.show()
# xaxis = ['time']
# yaxis = ['reward', 'steps', 'avg_q_max', 'avg_loss']
# for x in xaxis:
# for y in yaxis:
# fig, ax = plt.subplots(nrows=1, ncols=1)
# fig.suptitle(y)
# ax.set_ylabel(y)
# df.reset_index().plot(x=x, y=y, ax=ax)
# plt.show()
#
# yaxis = ['reward', 'steps', 'avg_q_max', 'avg_loss']
# for x in yaxis:
# for y in yaxis:
# if x != y:
# fig, ax = plt.subplots(nrows=1, ncols=1)
# fig.suptitle(y)
# ax.set_ylabel(y)
# df.reset_index().plot.scatter(x=x, y=y, ax=ax)
# plt.show()