Heating controller with neural thermal model written in Python
Jacek Kowalski
2018-06-24 66a9fb40efe1311b34a3cee3f83f10c6990759af
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
#!/usr/bin/env python3
 
import collections
import csv
import glob
import statistics
 
# type-values-aggregation-model[-epochs]
 
results = {}
 
for filename in glob.glob('design_*'):
    with open(filename) as fp:
        reader = csv.reader(fp, delimiter=' ')
        for row in reader:
            assert row[0] == 'RESULT'
            
            if row[1] not in results:
                results[row[1]] = [ [], [], [] ]
            
            for i in range(3):
                results[row[1]][i].append(float(row[2+i]))
 
 
results = collections.OrderedDict(sorted(results.items()))
 
for i in results:
    print(i, end='')
    for j in range(len(results[i])):
        print('', statistics.mean(results[i][j]), statistics.stdev(results[i][j]), end='')
    print()