Commit 73bcb2dd authored by 吕先亚's avatar 吕先亚

可以指定任意天数的预测

parent b8ea5c3f
......@@ -49,12 +49,12 @@ def do_reporter2(records=None, excel_name=None):
'Forcast On Date': item['date'],
'Ticker': info.get(item['rbd_id'])['ticker'].replace(' Index', '').replace(' Equity', ''),
'Forecast Business Days After': predict_term,
'In business days': LABEL_TAG.get(item['predict']),
'Forecast Label': LABEL_TAG.get(item['predict']),
'real outcome label': LABEL_TAG.get(real),
'random variable label': LABEL_TAG.get(random.randint(labels[0], labels[-1])),
'Ticker Name': json.loads(info.get(item['rbd_id'])['datas'])['chineseName'],
'Run On Time': item['create_time'].replace(minute=0, second=0),
'return in business days': rtn,
'return on Forecast Label': rtn,
'result': result
}
datas.append(data)
......@@ -85,7 +85,7 @@ def get_RMSE(datas):
return 0
tags = {v: k for k, v in LABEL_TAG.items()}
return (sum(
[(tags.get(data['real outcome label']) - tags.get(data['In business days'])) ** 2 for data in datas]) / len(
[(tags.get(data['real outcome label']) - tags.get(data['Forecast Label'])) ** 2 for data in datas]) / len(
datas)) ** 0.5
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment