To write pre

To write pre is not easy, I do not know whether the researches I have been working on is really of meaning.  But I carried on. I missed the opportunity of companying my girl friend to her graduate university. It seems that my value could not be embodied unless I am working. I do not need to appear to be valuable.

There are some technique problems in writing the paper, I don't know what is the better way to organize my materials and make them seem more theoretical. The background, the model, the method, the result and the analysis. I shall make the paper seems meaningful, including solid method, ample results.

The background is most difficult part, because it shows your understanding of this area. At this time, however, my understanding of the area is very limited, I have spent so much time coding and debug, and repeat the running and waiting for results. I know little about neural coding, but I think what I do is part of it. Many basic concept in this area is not clear. I shall make myself as clear as enough. The setback in nips should have taught me something. I know my ability is very limited and my ear is soft easily get light-headed with tm's temptation words. But I decided to grab this opportunity.Bless.

def output_data(all_pre, best, early_pre, pre_early_data, site_main, tasks): write_data = [] write_data_color = [] for i in tasks[best]: post = tasks[best][i] pre = all_pre[i] ff = False if i == 0: if pre is None: for _ in range(6): write_data.append("") write_data_color.append(0) elif post is None: ampr = np.nansum(list(pre[1].values())) write_data.append("%.4f" % ampr) for _ in range(4): write_data.append("") write_data.append("Abnormal") for _ in range(6): write_data_color.append(0) else: ampr = np.nansum(list(pre[1].values())) ampo = np.nansum(list(post[1].values())) mpr = np.nansum([pre[1][key] for key in pre[1].keys() if key != site_main]) mpo = np.nansum([post[1][key] for key in post[1].keys() if key != site_main]) write_data.append("%.4f" % ampr) write_data.append("%.4f" % ampo) write_data_color.append(0) write_data_color.append(0) if ampr == 0: write_data.append("0.0000%") write_data.append("0.0000%") write_data.append("0.0000%") write_data_color.append(1) write_data_color.append(0) write_data_color.append(0) write_data_color.append(0) ff = True else: write_data.append("%.4f" % ((ampo - ampr) / ampr * 100) + "%") if pre_early_data is None: std, avg = calculate_std_deviation(pre) else: if early_pre[i] is not None: std, avg = calculate_std_deviation(early_pre[i]) else: std, avg = None, 1 if std is not None: dev = std / avg write_data.append("%.4f" % (dev * 100) + "%") else: dev = -999999999 write_data.append("数据不全") if mpr == 0: write_data.append("0.0000%") else: write_data.append("%.4f" % ((mpo - mpr) / mpr * 100) + "%") if (ampo - ampr) / ampr >= 0: ff = True write_data_color.append(1) write_data_color.append(0) write_data_color.append(0) write_data_color.append(0) elif dev + (ampo - ampr) / ampr >= 0: write_data_color.append(0) write_data_color.append(1) write_data_color.append(0) write_data_color.append(0) ff = True elif mpr == 0: write_data_color.append(0) write_data_color.append(0) write_data_color.append(1) write_data_color.append(0) elif (mpo - mpr) / mpr >= 0: write_data_color.append(0) write_data_color.append(0) write_data_color.append(1) write_data_color.append(0) ff = True else: write_data_color.append(-1) write_data_color.append(-1) write_data_color.append(-1) write_data_color.append(0) write_data.append("Normal" if ff else "Abnormal") elif i < 7: if pre is None: for _ in range(5): write_data.append("") write_data_color.append(0) elif post is None: ampr = np.nansum(list(pre[1].values())) write_data.append("%.4f" % ampr) for _ in range(3): write_data.append("") write_data_color.append(0) write_data.append("Abnormal") for _ in range(5): write_data_color.append(0) else: ampr = np.nansum(list(pre[1].values())) ampo = np.nansum(list(post[1].values())) write_data.append("%.4f" % ampr) write_data.append("%.4f" % ampo) write_data_color.append(0) write_data_color.append(0) if ampr == 0: write_data.append("0.0000%") write_data.append("0.0000%") write_data_color.append(0) write_data_color.append(1) write_data_color.append(0) ff = True else: write_data.append("%.4f" % ((ampo - ampr) / ampr * 100) + "%") if pre_early_data is None: std, avg = calculate_std_deviation(pre) else: if early_pre[i] is not None: std, avg = calculate_std_deviation(early_pre[i]) else: std, avg = None, 1 if std is not None: dev = (std / avg) if i < 3 else (std / ampr) write_data.append("%.4f" % (dev * 100) + "%") else: dev = -99999999 write_data.append("数据不全") if (ampo - ampr) / ampr >= 0: write_data_color.append(1) write_data_color.append(0) write_data_color.append(0) ff = True elif dev + (ampo - ampr) / ampr >= 0: write_data_color.append(0) write_data_color.append(1) write_data_color.append(0) ff = True else: write_data_color.append(-1) write_data_color.append(-1) write_data_color.append(0) write_data.append("Normal" if ff else "Abnormal") else: if pre is None: for _ in range(5): write_data.append("") write_data_color.append(0) elif post is None: write_data.append("%.4f" % pre) write_data.append("") write_data.append("0.6000%") write_data.append("Abnormal") for _ in range(5): write_data_color.append(0) else: write_data.append("%.4f" % pre) write_data.append("%.4f" % post) write_data_color.append(0) write_data_color.append(0) if pre == 0: ff = True write_data.append("0.000%") write_data_color.append(1) write_data_color.append(0) write_data_color.append(0) else: write_data.append("%.4f" % ((post - pre) / pre * 100) + "%") if (post - pre) / pre >= 0: ff = True write_data_color.append(1) write_data_color.append(0) write_data_color.append(0) elif (post - pre) / pre + 0.006 >= 0: ff = True write_data_color.append(0) write_data_color.append(1) write_data_color.append(0) else: write_data_color.append(-1) write_data_color.append(-1) write_data_color.append(-1) write_data.append("0.6000%") write_data.append("Normal" if ff else "Abnormal") return write_data, write_data_color 优化代码
08-14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值