-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathplot_data.py
More file actions
executable file
·26 lines (20 loc) · 849 Bytes
/
plot_data.py
File metadata and controls
executable file
·26 lines (20 loc) · 849 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
#!/usr/bin/python3
# This script plots the data produced by run_trials.sh
import matplotlib.pyplot as plt
from matplotlib.axes import Axes
import numpy
CSV_FILE = 'results.csv'
def main():
# read the data from the CSV files
data = numpy.genfromtxt(CSV_FILE, delimiter=',', names=True)
# plot training steps vs classification accuracy
plt.plot(data['n'], data['false_positive'], 'r.', markersize=20)
plt.plot(data['n'], data['false_negative'], 'g.', markersize=20)
plt.plot(data['n'], data['accuracy'], 'b.', markersize=20)
plt.title('Number of Training Steps vs Classification Accuracy \n and False Negative/Positive Rates')
plt.xlabel('Number of Training Steps')
plt.ylabel('Classification Accuracy')
plt.grid(True)
plt.savefig('training_steps_vs_accuracy.png')
if __name__=='__main__':
main()