Heating controller with neural thermal model written in Python
Jacek Kowalski
2018-06-24 425bf71fc0b24b547006686d83404c54b983de0b
commit | author | age
425bf7 1 #!/usr/bin/env python3
JK 2
3 import collections
4 import csv
5 import glob
6 import statistics
7
8 # type-values-aggregation-model[-epochs]
9
10 results = {}
11
12 for filename in glob.glob('design_*'):
13     with open(filename) as fp:
14         reader = csv.reader(fp, delimiter=' ')
15         for row in reader:
16             assert row[0] == 'RESULT'
17             
18             if row[1] not in results:
19                 results[row[1]] = [ [], [], [] ]
20             
21             for i in range(3):
22                 results[row[1]][i].append(float(row[2+i]))
23
24
25 results = collections.OrderedDict(sorted(results.items()))
26
27 for i in results:
28     print(i, end='')
29     for j in range(len(results[i])):
30         print('', statistics.mean(results[i][j]), statistics.stdev(results[i][j]), end='')
31     print()