代码拉取完成,页面将自动刷新
# common library
import pandas as pd
import numpy as np
import time
from stable_baselines.common.vec_env import DummyVecEnv
# preprocessor
from preprocessing.preprocessors import *
# config
from config.config import *
# model
from model.models import *
def run_model() -> None:
"""Train the model."""
# read and preprocess data
data = preprocess_data()
data = add_turbulence(data)
# 2015/10/01 is the date that validation starts
# 2016/01/01 is the date that real trading starts
# unique_trade_date needs to start from 2015/10/01 for validation purpose
unique_trade_date = data[(data.datadate > 20151001)&(data.datadate <= 20200707)].datadate.unique()
# rebalance_window is the number of months to retrain the model
# validation_window is the numebr of months to validation the model and select for trading
rebalance_window = 63
validation_window = 63
## Ensemble Strategy
run_ensemble_strategy(df=data,
unique_trade_date= unique_trade_date,
rebalance_window = rebalance_window,
validation_window=validation_window)
#_logger.info(f"saving model version: {_version}")
if __name__ == "__main__":
run_model()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。