提交 38cb7f62 作者: 朱学凯

add z-score result

上级 6b86fe53
...@@ -30,9 +30,10 @@ def eval(pred_path, label_path): ...@@ -30,9 +30,10 @@ def eval(pred_path, label_path):
if __name__ == '__main__': if __name__ == '__main__':
with open('pre_test.sh', 'r') as f: # with open('pre_test.sh', 'r') as f:
pred_dir = f.readline() # pred_dir = f.readline()
pred_dir = pred_dir.split()[5].split('/')[-1] # pred_dir = pred_dir.split()[5].split('/')[-1]
pred_result = './predict/{}/test.txt'.format(pred_dir) # pred_result = './predict/{}/test.txt'.format(pred_dir)
pred_result = './predict/lr-1e-5-batch-32-e-10-layer9-0429-z-10-step-74133/test.txt'
test_label_path = './data/test_ic50' test_label_path = './data/test_ic50'
eval(pred_result, test_label_path) eval(pred_result, test_label_path)
This source diff could not be displayed because it is too large. You can view the blob instead.
RMSE : 1.0464617506947576 ; Pearson Correlation Coefficient : 0.7087386087513284
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
RMSE : 1.077407260875347 ; Pearson Correlation Coefficient : 0.6837182462635899
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
RMSE : 9.781247479007378 ; Pearson Correlation Coefficient : 0.7332126683709378 RMSE : 1.3901506777912391 ; Pearson Correlation Coefficient : 0.7332126683709385
\ No newline at end of file \ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
6.339674062480976
1.4751794034241978
...@@ -18,12 +18,29 @@ def z_score(data, save, enlarge): ...@@ -18,12 +18,29 @@ def z_score(data, save, enlarge):
for aff in tqdm(new_affinity): for aff in tqdm(new_affinity):
f.write(str(aff) + '\n') f.write(str(aff) + '\n')
def reform(input_file_path, result_save_path, average, std, enlarge):
with open(input_file_path, 'r') as f:
res = f.readlines()
with open(result_save_path, 'w') as f:
for line in tqdm(res):
data = float(line.strip())
ori = ((data / enlarge) * std) + average
f.write(str(ori) + '\n')
if __name__ == '__main__': if __name__ == '__main__':
data = '../data/train_ic50' average = 6.339674062480976
save = '../data/train_z_1_ic50' std = 1.4751794034241978
enlarge = 1
z_score(data, save, enlarge) # gengerate z-score dataset
\ No newline at end of file # data = '../data/train_ic50'
# save = '../data/train_z_1_ic50'
# enlarge = 1
# z_score(data, save, enlarge)
# reform result
result = '../predict/lr-1e-5-batch-32-e-10-layer9-0429-z-10-step-74133/test_10.txt'
save = '../predict/lr-1e-5-batch-32-e-10-layer9-0429-z-10-step-74133/test.txt'
reform(result, save, average, std, 100)
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论