-
Notifications
You must be signed in to change notification settings - Fork 0
/
plotting.py
37 lines (28 loc) · 820 Bytes
/
plotting.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
""" Developer: Roshan Gopalakrishnan
Contact: [email protected]
Description:
This code is to plot accuracy vs epochs generated while training.
"""
""" import packages """
import matplotlib.pyplot as plt
import csv
import numpy as np
from itertools import izip
""" Initialize variables """
x = []
y_train_acc = []
y_test_acc = []
""" Open CSV and save the columns needed """
with open('accuracy_vs_epochs.csv','r') as file:
data = csv.reader(file, delimiter=';')
for i, row in enumerate(data):
x.append(i)
y_train_acc.append(row[1])
y_test_acc.append(row[3])
""" Plot the result """
p1 = plt.plot(x[1:], y_train_acc[1:], 'k')
p2 = plt.plot(x[1:], y_test_acc[1:], 'b')
plt.xlabel('epochs')
plt.ylabel('Accuracy')
plt.title('Plotting Accuracy')
plt.show()