月度报告调试
This commit is contained in:
parent
0683d411f1
commit
d3d481d875
@ -50,6 +50,7 @@ global_config.update({
|
|||||||
'login_pushreport_url': login_pushreport_url,
|
'login_pushreport_url': login_pushreport_url,
|
||||||
'login_data': login_data,
|
'login_data': login_data,
|
||||||
'upload_url': upload_url,
|
'upload_url': upload_url,
|
||||||
|
'upload_data': upload_data,
|
||||||
'upload_warning_url': upload_warning_url,
|
'upload_warning_url': upload_warning_url,
|
||||||
'warning_data': warning_data,
|
'warning_data': warning_data,
|
||||||
|
|
||||||
@ -418,6 +419,8 @@ def predict_main():
|
|||||||
model_results3 = model_losss(sqlitedb, end_time=end_time)
|
model_results3 = model_losss(sqlitedb, end_time=end_time)
|
||||||
logger.info('训练数据绘图end')
|
logger.info('训练数据绘图end')
|
||||||
|
|
||||||
|
push_market_value()
|
||||||
|
|
||||||
# 模型报告
|
# 模型报告
|
||||||
logger.info('制作报告ing')
|
logger.info('制作报告ing')
|
||||||
title = f'{settings}--{end_time}-预测报告' # 报告标题
|
title = f'{settings}--{end_time}-预测报告' # 报告标题
|
||||||
@ -429,7 +432,7 @@ def predict_main():
|
|||||||
logger.info('制作报告end')
|
logger.info('制作报告end')
|
||||||
logger.info('模型训练完成')
|
logger.info('模型训练完成')
|
||||||
|
|
||||||
push_market_value()
|
|
||||||
|
|
||||||
# # LSTM 单变量模型
|
# # LSTM 单变量模型
|
||||||
# ex_Lstm(df,input_seq_len=input_size,output_seq_len=horizon,is_debug=is_debug,dataset=dataset)
|
# ex_Lstm(df,input_seq_len=input_size,output_seq_len=horizon,is_debug=is_debug,dataset=dataset)
|
||||||
|
@ -1404,7 +1404,7 @@ def model_losss(sqlitedb, end_time):
|
|||||||
plt.close()
|
plt.close()
|
||||||
|
|
||||||
_plt_predict_ture(df_combined3)
|
_plt_predict_ture(df_combined3)
|
||||||
# _plt_modeltopten_predict_ture(df_combined4)
|
_plt_modeltopten_predict_ture(df_combined4)
|
||||||
_plt_predict_table(df_combined3)
|
_plt_predict_table(df_combined3)
|
||||||
_plt_model_results3()
|
_plt_model_results3()
|
||||||
|
|
||||||
@ -1816,7 +1816,7 @@ def model_losss_juxitingbak(sqlitedb, end_time):
|
|||||||
plt.text(i, j, str(j), ha='center', va='bottom')
|
plt.text(i, j, str(j), ha='center', va='bottom')
|
||||||
|
|
||||||
# 当前日期画竖虚线
|
# 当前日期画竖虚线
|
||||||
plt.axvline(x=df['ds'].iloc[-horizon], color='r', linestyle='--')
|
plt.axvline(x=df['ds'].iloc[-config.horizon], color='r', linestyle='--')
|
||||||
plt.legend()
|
plt.legend()
|
||||||
plt.xlabel('日期')
|
plt.xlabel('日期')
|
||||||
# 自动设置横轴日期显示
|
# 自动设置横轴日期显示
|
||||||
@ -1835,8 +1835,8 @@ def model_losss_juxitingbak(sqlitedb, end_time):
|
|||||||
ax.axis('off') # 关闭坐标轴
|
ax.axis('off') # 关闭坐标轴
|
||||||
# 数值保留2位小数
|
# 数值保留2位小数
|
||||||
df = df.round(2)
|
df = df.round(2)
|
||||||
df = df[-horizon:]
|
df = df[-config.horizon:]
|
||||||
df['Day'] = [f'Day_{i}' for i in range(1, horizon+1)]
|
df['Day'] = [f'Day_{i}' for i in range(1, config.horizon+1)]
|
||||||
# Day列放到最前面
|
# Day列放到最前面
|
||||||
df = df[['Day'] + list(df.columns[:-1])]
|
df = df[['Day'] + list(df.columns[:-1])]
|
||||||
table = ax.table(cellText=df.values,
|
table = ax.table(cellText=df.values,
|
||||||
@ -2294,7 +2294,6 @@ def brent_export_pdf(num_indicators=475, num_models=21, num_dayindicator=202, in
|
|||||||
df_bdwd = get_bdwd_predict_data()
|
df_bdwd = get_bdwd_predict_data()
|
||||||
# df转置
|
# df转置
|
||||||
df_bdwd = df_bdwd.T
|
df_bdwd = df_bdwd.T
|
||||||
df_bdwd = df_bdwd.T
|
|
||||||
# df重置索引
|
# df重置索引
|
||||||
df_bdwd = df_bdwd.reset_index()
|
df_bdwd = df_bdwd.reset_index()
|
||||||
# 添加预测值表格
|
# 添加预测值表格
|
||||||
@ -2497,16 +2496,16 @@ def brent_export_pdf(num_indicators=475, num_models=21, num_dayindicator=202, in
|
|||||||
config.dataset, reportname), pagesize=letter)
|
config.dataset, reportname), pagesize=letter)
|
||||||
doc.build(content)
|
doc.build(content)
|
||||||
# pdf 上传到数字化信息平台
|
# pdf 上传到数字化信息平台
|
||||||
try:
|
# try:
|
||||||
if config.is_update_report:
|
# if config.is_update_report:
|
||||||
with open(os.path.join(config.dataset, reportname), 'rb') as f:
|
# with open(os.path.join(config.dataset, reportname), 'rb') as f:
|
||||||
base64_data = base64.b64encode(f.read()).decode('utf-8')
|
# base64_data = base64.b64encode(f.read()).decode('utf-8')
|
||||||
config.upload_data["data"]["fileBase64"] = base64_data
|
# config.upload_data["data"]["fileBase64"] = base64_data
|
||||||
config.upload_data["data"]["fileName"] = reportname
|
# config.upload_data["data"]["fileName"] = reportname
|
||||||
token = get_head_auth_report()
|
# token = get_head_auth_report()
|
||||||
upload_report_data(token, config.upload_data)
|
# upload_report_data(token, config.upload_data)
|
||||||
except TimeoutError as e:
|
# except TimeoutError as e:
|
||||||
print(f"请求超时: {e}")
|
# print(f"请求超时: {e}")
|
||||||
|
|
||||||
|
|
||||||
@exception_logger
|
@exception_logger
|
||||||
|
Loading…
Reference in New Issue
Block a user