原油月度预测调试
This commit is contained in:
parent
3a1d85f275
commit
2997df97e0
@ -194,21 +194,21 @@ table_name = 'v_tbl_crude_oil_warning'
|
||||
|
||||
|
||||
# 开关
|
||||
is_train = True # 是否训练
|
||||
is_train = False # 是否训练
|
||||
is_debug = False # 是否调试
|
||||
is_eta = True # 是否使用eta接口
|
||||
is_eta = False # 是否使用eta接口
|
||||
is_market = True # 是否通过市场信息平台获取特征 ,在is_eta 为true 的情况下生效
|
||||
is_timefurture = True # 是否使用时间特征
|
||||
is_fivemodels = False # 是否使用之前保存的最佳的5个模型
|
||||
is_edbcode = False # 特征使用edbcoding列表中的
|
||||
is_edbnamelist = False # 自定义特征,对应上面的edbnamelist
|
||||
is_update_eta = False # 预测结果上传到eta
|
||||
is_update_report = True # 是否上传报告
|
||||
is_update_report = False # 是否上传报告
|
||||
is_update_warning_data = False # 是否上传预警数据
|
||||
is_update_predict_value = True # 是否上传预测值到市场信息平台
|
||||
is_update_predict_value = False # 是否上传预测值到市场信息平台
|
||||
is_del_corr = 0.6 # 是否删除相关性高的特征,取值为 0-1 ,0 为不删除,0.6 表示删除相关性小于0.6的特征
|
||||
is_del_tow_month = True # 是否删除两个月不更新的特征
|
||||
is_bdwd = True # 是否使用八大维度
|
||||
is_del_tow_month = False # 是否删除两个月不更新的特征
|
||||
is_bdwd = False # 是否使用八大维度
|
||||
|
||||
|
||||
# 连接到数据库
|
||||
|
@ -3,7 +3,7 @@
|
||||
from lib.dataread import *
|
||||
from config_jingbo_yuedu import *
|
||||
from lib.tools import SendMail, exception_logger
|
||||
from models.nerulforcastmodels import ex_Model, model_losss, model_losss_juxiting, brent_export_pdf, tansuanli_export_pdf, pp_export_pdf, model_losss_juxiting
|
||||
from models.nerulforcastmodels import ex_Model, model_losss
|
||||
import datetime
|
||||
import torch
|
||||
torch.set_float32_matmul_precision("high")
|
||||
@ -417,18 +417,18 @@ def predict_main():
|
||||
model_results3 = model_losss(sqlitedb, end_time=end_time)
|
||||
logger.info('训练数据绘图end')
|
||||
|
||||
# 模型报告
|
||||
logger.info('制作报告ing')
|
||||
title = f'{settings}--{end_time}-预测报告' # 报告标题
|
||||
reportname = f'Brent原油大模型月度预测--{end_time}.pdf' # 报告文件名
|
||||
reportname = reportname.replace(':', '-') # 替换冒号
|
||||
brent_export_pdf(dataset=dataset, num_models=5 if is_fivemodels else 22, time=end_time,
|
||||
reportname=reportname, sqlitedb=sqlitedb),
|
||||
# # 模型报告
|
||||
# logger.info('制作报告ing')
|
||||
# title = f'{settings}--{end_time}-预测报告' # 报告标题
|
||||
# reportname = f'Brent原油大模型月度预测--{end_time}.pdf' # 报告文件名
|
||||
# reportname = reportname.replace(':', '-') # 替换冒号
|
||||
# brent_export_pdf(dataset=dataset, num_models=5 if is_fivemodels else 22, time=end_time,
|
||||
# reportname=reportname, sqlitedb=sqlitedb),
|
||||
|
||||
logger.info('制作报告end')
|
||||
logger.info('模型训练完成')
|
||||
# logger.info('制作报告end')
|
||||
# logger.info('模型训练完成')
|
||||
|
||||
push_market_value()
|
||||
# push_market_value()
|
||||
|
||||
# # LSTM 单变量模型
|
||||
# ex_Lstm(df,input_seq_len=input_size,output_seq_len=horizon,is_debug=is_debug,dataset=dataset)
|
||||
@ -455,13 +455,13 @@ def predict_main():
|
||||
if __name__ == '__main__':
|
||||
# global end_time
|
||||
# 遍历2024-11-25 到 2024-12-3 之间的工作日日期
|
||||
# for i_time in pd.date_range('2022-1-1', '2025-3-26', freq='M'):
|
||||
# try:
|
||||
# global_config['end_time'] = i_time.strftime('%Y-%m-%d')
|
||||
# predict_main()
|
||||
for i_time in pd.date_range('2025-1-1', '2025-3-26', freq='B'):
|
||||
# try:
|
||||
global_config['end_time'] = i_time.strftime('%Y-%m-%d')
|
||||
predict_main()
|
||||
# except Exception as e:
|
||||
# logger.info(f'预测失败:{e}')
|
||||
# continue
|
||||
|
||||
predict_main()
|
||||
# predict_main()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user