PriceForecast/eta数据调试.py
2025-05-26 14:53:42 +08:00

284 lines
12 KiB
Python

# 创建eta自定义指标数据
from config_jingbo import *
from lib.dataread import *
global_config.update({
# 核心参数
'logger': logger,
'dataset': dataset,
'y': y,
'is_debug': is_debug,
'is_train': is_train,
'is_fivemodels': is_fivemodels,
'is_update_report': is_update_report,
'settings': settings,
'weight_dict': weight_dict,
'bdwdname': bdwdname,
# 模型参数
'data_set': data_set,
'input_size': input_size,
'horizon': horizon,
'train_steps': train_steps,
'val_check_steps': val_check_steps,
'val_size': val_size,
'test_size': test_size,
'modelsindex': modelsindex,
'rote': rote,
'bdwd_items': bdwd_items,
# 特征工程开关
'is_del_corr': is_del_corr,
'is_del_tow_month': is_del_tow_month,
'is_eta': is_eta,
'is_update_eta': is_update_eta,
'is_fivemodels': is_fivemodels,
'is_update_predict_value': is_update_predict_value,
'early_stop_patience_steps': early_stop_patience_steps,
# 时间参数
'start_year': start_year,
'end_time': end_time or datetime.datetime.now().strftime("%Y-%m-%d"),
'freq': freq, # 保持列表结构
# 接口配置
'login_pushreport_url': login_pushreport_url,
'login_data': login_data,
'upload_url': upload_url,
'upload_data': upload_data,
'upload_warning_url': upload_warning_url,
'warning_data': warning_data,
# 查询接口
'query_data_list_item_nos_url': query_data_list_item_nos_url,
'query_data_list_item_nos_data': query_data_list_item_nos_data,
# 上传数据项
'push_data_value_list_url': push_data_value_list_url,
'push_data_value_list_data': push_data_value_list_data,
# 上传预警数据
'push_waring_data_value_list_url': push_waring_data_value_list_url,
'push_waring_data_value_list_data': push_waring_data_value_list_data,
# 获取取消订阅的数据
'get_waring_data_value_list_url': get_waring_data_value_list_url,
'get_waring_data_value_list_data': get_waring_data_value_list_data,
# eta 配置
'APPID': APPID,
'SECRET': SECRET,
'etadata': data,
'edbcodelist': edbcodelist,
'ClassifyId': ClassifyId,
'edbcodedataurl': edbcodedataurl,
'classifyidlisturl': classifyidlisturl,
'edbdatapushurl': edbdatapushurl,
'edbdeleteurl': edbdeleteurl,
'edbbusinessurl': edbbusinessurl,
'ClassifyId': ClassifyId,
'classifylisturl': classifylisturl,
# 数据库配置
'sqlitedb': sqlitedb,
'bdwd_items': bdwd_items,
'is_bdwd': is_bdwd,
})
logger.info('从eta获取数据...')
signature = BinanceAPI(APPID, SECRET)
etadata = EtaReader(signature=signature,
classifylisturl=classifylisturl,
classifyidlisturl=classifyidlisturl,
edbcodedataurl=edbcodedataurl,
edbcodelist=edbcodelist,
edbdatapushurl=edbdatapushurl,
edbdeleteurl=edbdeleteurl,
edbbusinessurl=edbbusinessurl,
classifyId=ClassifyId,)
# eta自有数据指标编码
modelsindex = {
'NHITS': 'SELF0000077',
'Informer': 'SELF0000078',
'LSTM': 'SELF0000079',
'iTransformer': 'SELF0000080',
'TSMixer': 'SELF0000081',
'TSMixerx': 'SELF0000082',
'PatchTST': 'SELF0000083',
'RNN': 'SELF0000084',
'GRU': 'SELF0000085',
'TCN': 'SELF0000086',
'BiTCN': 'SELF0000087',
'DilatedRNN': 'SELF0000088',
'MLP': 'SELF0000089',
'DLinear': 'SELF0000090',
'NLinear': 'SELF0000091',
'TFT': 'SELF0000092',
'FEDformer': 'SELF0000093',
'StemGNN': 'SELF0000094',
'MLPMultivariate': 'SELF0000095',
'TiDE': 'SELF0000096',
'DeepNPTS': 'SELF0000097'
}
selfid = {
"聚烯烃价格预测NHITS模型-次周": "SELF0000231",
"聚烯烃价格预测Informer模型-次周": "SELF0000232",
"聚烯烃价格预测LSTM模型-次周": "SELF0000233",
"聚烯烃价格预测iTransformer模型-次周": "SELF0000234",
"聚烯烃价格预测TSMixer模型-次周": "SELF0000235",
"聚烯烃价格预测TSMixerx模型-次周": "SELF0000236",
"聚烯烃价格预测PatchTST模型-次周": "SELF0000237",
"聚烯烃价格预测RNN模型-次周": "SELF0000238",
"聚烯烃价格预测GRU模型-次周": "SELF0000239",
"聚烯烃价格预测TCN模型-次周": "SELF0000240",
"聚烯烃价格预测BiTCN模型-次周": "SELF0000241",
"聚烯烃价格预测DilatedRNN模型-次周": "SELF0000242",
"聚烯烃价格预测MLP模型-次周": "SELF0000243",
"聚烯烃价格预测DLinear模型-次周": "SELF0000244",
"聚烯烃价格预测NLinear模型-次周": "SELF0000245",
"聚烯烃价格预测TFT模型-次周": "SELF0000246",
"聚烯烃价格预测FEDformer模型-次周": "SELF0000247",
"聚烯烃价格预测StemGNN模型-次周": "SELF0000248",
"聚烯烃价格预测MLPMultivariate模型-次周": "SELF0000249",
"聚烯烃价格预测TiDE模型-次周": "SELF0000250",
"聚烯烃价格预测DeepNPTS模型-次周": "SELF0000251",
"聚烯烃价格预测NBEATS模型-次周": "SELF0000252",
"聚烯烃价格预测NHITS模型-隔周": "SELF0000253",
"聚烯烃价格预测Informer模型-隔周": "SELF0000254",
"聚烯烃价格预测LSTM模型-隔周": "SELF0000255",
"聚烯烃价格预测iTransformer模型-隔周": "SELF0000256",
"聚烯烃价格预测TSMixer模型-隔周": "SELF0000257",
"聚烯烃价格预测TSMixerx模型-隔周": "SELF0000258",
"聚烯烃价格预测PatchTST模型-隔周": "SELF0000259",
"聚烯烃价格预测RNN模型-隔周": "SELF0000260",
"聚烯烃价格预测GRU模型-隔周": "SELF0000261",
"聚烯烃价格预测TCN模型-隔周": "SELF0000262",
"聚烯烃价格预测BiTCN模型-隔周": "SELF0000263",
"聚烯烃价格预测DilatedRNN模型-隔周": "SELF0000264",
"聚烯烃价格预测MLP模型-隔周": "SELF0000265",
"聚烯烃价格预测DLinear模型-隔周": "SELF0000266",
"聚烯烃价格预测NLinear模型-隔周": "SELF0000267",
"聚烯烃价格预测TFT模型-隔周": "SELF0000268",
"聚烯烃价格预测FEDformer模型-隔周": "SELF0000269",
"聚烯烃价格预测StemGNN模型-隔周": "SELF0000270",
"聚烯烃价格预测MLPMultivariate模型-隔周": "SELF0000271",
"聚烯烃价格预测TiDE模型-隔周": "SELF0000272",
"聚烯烃价格预测DeepNPTS模型-隔周": "SELF0000273",
"聚烯烃价格预测NBEATS模型-隔周": "SELF0000274",
"聚烯烃价格预测NHITS模型-次月": "SELF0000275",
"聚烯烃价格预测Informer模型-次月": "SELF0000276",
"聚烯烃价格预测LSTM模型-次月": "SELF0000277",
"聚烯烃价格预测iTransformer模型-次月": "SELF0000278",
"聚烯烃价格预测TSMixer模型-次月": "SELF0000279",
"聚烯烃价格预测TSMixerx模型-次月": "SELF0000280",
"聚烯烃价格预测PatchTST模型-次月": "SELF0000281",
"聚烯烃价格预测RNN模型-次月": "SELF0000282",
"聚烯烃价格预测GRU模型-次月": "SELF0000283",
"聚烯烃价格预测TCN模型-次月": "SELF0000284",
"聚烯烃价格预测BiTCN模型-次月": "SELF0000285",
"聚烯烃价格预测DilatedRNN模型-次月": "SELF0000286",
"聚烯烃价格预测MLP模型-次月": "SELF0000287",
"聚烯烃价格预测DLinear模型-次月": "SELF0000288",
"聚烯烃价格预测NLinear模型-次月": "SELF0000289",
"聚烯烃价格预测TFT模型-次月": "SELF0000290",
"聚烯烃价格预测FEDformer模型-次月": "SELF0000291",
"聚烯烃价格预测StemGNN模型-次月": "SELF0000292",
"聚烯烃价格预测MLPMultivariate模型-次月": "SELF0000293",
"聚烯烃价格预测TiDE模型-次月": "SELF0000294",
"聚烯烃价格预测DeepNPTS模型-次月": "SELF0000295",
"聚烯烃价格预测NBEATS模型-次月": "SELF0000296",
"聚烯烃价格预测NHITS模型-次二月": "SELF0000297",
"聚烯烃价格预测Informer模型-次二月": "SELF0000298",
"聚烯烃价格预测LSTM模型-次二月": "SELF0000299",
"聚烯烃价格预测iTransformer模型-次二月": "SELF0000300",
"聚烯烃价格预测TSMixer模型-次二月": "SELF0000301",
"聚烯烃价格预测TSMixerx模型-次二月": "SELF0000302",
"聚烯烃价格预测PatchTST模型-次二月": "SELF0000303",
"聚烯烃价格预测RNN模型-次二月": "SELF0000304",
"聚烯烃价格预测GRU模型-次二月": "SELF0000305",
"聚烯烃价格预测TCN模型-次二月": "SELF0000306",
"聚烯烃价格预测BiTCN模型-次二月": "SELF0000307",
"聚烯烃价格预测DilatedRNN模型-次二月": "SELF0000308",
"聚烯烃价格预测MLP模型-次二月": "SELF0000309",
"聚烯烃价格预测DLinear模型-次二月": "SELF0000310",
"聚烯烃价格预测NLinear模型-次二月": "SELF0000311",
"聚烯烃价格预测TFT模型-次二月": "SELF0000312",
"聚烯烃价格预测FEDformer模型-次二月": "SELF0000313",
"聚烯烃价格预测StemGNN模型-次二月": "SELF0000314",
"聚烯烃价格预测MLPMultivariate模型-次二月": "SELF0000315",
"聚烯烃价格预测TiDE模型-次二月": "SELF0000316",
"聚烯烃价格预测DeepNPTS模型-次二月": "SELF0000317",
"聚烯烃价格预测NBEATS模型-次二月": "SELF0000318",
"聚烯烃价格预测NHITS模型-次三月": "SELF0000319",
"聚烯烃价格预测Informer模型-次三月": "SELF0000320",
"聚烯烃价格预测LSTM模型-次三月": "SELF0000321",
"聚烯烃价格预测iTransformer模型-次三月": "SELF0000322",
"聚烯烃价格预测TSMixer模型-次三月": "SELF0000323",
"聚烯烃价格预测TSMixerx模型-次三月": "SELF0000324",
"聚烯烃价格预测PatchTST模型-次三月": "SELF0000325",
"聚烯烃价格预测RNN模型-次三月": "SELF0000326",
"聚烯烃价格预测GRU模型-次三月": "SELF0000327",
"聚烯烃价格预测TCN模型-次三月": "SELF0000328",
"聚烯烃价格预测BiTCN模型-次三月": "SELF0000329",
"聚烯烃价格预测DilatedRNN模型-次三月": "SELF0000330",
"聚烯烃价格预测MLP模型-次三月": "SELF0000331",
"聚烯烃价格预测DLinear模型-次三月": "SELF0000332",
"聚烯烃价格预测NLinear模型-次三月": "SELF0000333",
"聚烯烃价格预测TFT模型-次三月": "SELF0000334",
"聚烯烃价格预测FEDformer模型-次三月": "SELF0000335",
"聚烯烃价格预测StemGNN模型-次三月": "SELF0000336",
"聚烯烃价格预测MLPMultivariate模型-次三月": "SELF0000337",
"聚烯烃价格预测TiDE模型-次三月": "SELF0000338",
"聚烯烃价格预测DeepNPTS模型-次三月": "SELF0000339",
"聚烯烃价格预测NBEATS模型-次三月": "SELF0000340",
"聚烯烃价格预测NHITS模型-次四月": "SELF0000341",
"聚烯烃价格预测Informer模型-次四月": "SELF0000342",
"聚烯烃价格预测LSTM模型-次四月": "SELF0000343",
"聚烯烃价格预测iTransformer模型-次四月": "SELF0000344",
"聚烯烃价格预测TSMixer模型-次四月": "SELF0000345",
"聚烯烃价格预测TSMixerx模型-次四月": "SELF0000346",
"聚烯烃价格预测PatchTST模型-次四月": "SELF0000347",
"聚烯烃价格预测RNN模型-次四月": "SELF0000348",
"聚烯烃价格预测GRU模型-次四月": "SELF0000349",
"聚烯烃价格预测TCN模型-次四月": "SELF0000350",
"聚烯烃价格预测BiTCN模型-次四月": "SELF0000351",
"聚烯烃价格预测DilatedRNN模型-次四月": "SELF0000352",
"聚烯烃价格预测MLP模型-次四月": "SELF0000353",
"聚烯烃价格预测DLinear模型-次四月": "SELF0000354",
"聚烯烃价格预测NLinear模型-次四月": "SELF0000355",
"聚烯烃价格预测TFT模型-次四月": "SELF0000356",
"聚烯烃价格预测FEDformer模型-次四月": "SELF0000357",
"聚烯烃价格预测StemGNN模型-次四月": "SELF0000358",
"聚烯烃价格预测MLPMultivariate模型-次四月": "SELF0000359",
"聚烯烃价格预测TiDE模型-次四月": "SELF0000360",
"聚烯烃价格预测DeepNPTS模型-次四月": "SELF0000361",
"聚烯烃价格预测NBEATS模型-次四月": "SELF0000362",
}
date = '2025-02-13'
value = 333444
for k, v in selfid.items():
list = []
list.append({'Date': date, 'Value': value})
data['DataList'] = list
data['IndexCode'] = v
data['IndexName'] = k
data['Remark'] = k
etadata.push_data(data)
# data['IndexCode'] = modelsindex[m]
# data['StartDate'] = '2025-01-01'
# data['EndDate'] = '2025-03-13'
# # data['Remark'] = m
# etadata.del_business(data=data)
pass