-
Notifications
You must be signed in to change notification settings - Fork 83
/
summarize_fdy.py
33 lines (27 loc) · 898 Bytes
/
summarize_fdy.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
from __future__ import print_function
import os
import re
import numpy as np
import pdb
from scipy import stats
line_num = -1
seed_range = range(1, 6)
datasets = ['yahoo_music', 'douban', 'flixster']
prefixs = ['_s']
print()
for prefix in prefixs:
print('Results of ' + prefix)
for dataset in datasets:
res_base = 'results/' + dataset + prefix
RMSE = []
for seed in seed_range:
res_dir = res_base + str(seed) + '_testmode/log.txt'
with open(res_dir, 'r') as f:
line = f.readlines()[line_num]
rmse = float(line.split(' ')[-1])
RMSE.append(rmse)
RMSE = np.array(RMSE)
print('\033[91m Results of ' + dataset + '\033[00m')
print(RMSE)
print('Mean and std of test rmse:')
print('%.4f$\pm$%.4f'%(np.around(np.mean(RMSE), 4), np.around(np.std(RMSE), 4)))