df = m4.data.read()
print(df.shape)
df
df = m5.data.read()
x = df["x"]
print(x.shape)
df1 = pd.DataFrame(x)
df1.to_csv("滚动序列窗口_2.csv")
df = m7.data.read()
x = df["x"]
df1 = pd.DataFrame(x)
df1.to_csv("滚动序列窗口_3.csv")
df = m6.data.read()
x = df["x"]
print(x)
# 本代码由可视化策略环境自动生成 2021年7月9日11:09
# 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
m1 = M.instruments.v2(
start_date='2021-06-01',
end_date='2021-07-01',
market='CN_STOCK_A',
instrument_list='000001.SZA',
max_count=0
)
m3 = M.input_features.v1(
features="""close_0/mean(close_0,5)
close_0/open_0
open_0/mean(close_0,5)
"""
)
m2 = M.general_feature_extractor.v7(
instruments=m1.data,
features=m3.data,
start_date='',
end_date='',
before_start_days=0
)
m4 = M.derived_feature_extractor.v3(
input_data=m2.data,
features=m3.data,
date_col='date',
instrument_col='instrument',
drop_na=True,
remove_extra_columns=False,
user_functions={}
)
m5 = M.dl_convert_to_bin.v2(
input_data=m4.data,
features=m3.data,
window_size=2,
feature_clip=5,
flatten=True,
window_along_col='instrument'
)
m7 = M.dl_convert_to_bin.v2(
input_data=m4.data,
features=m3.data,
window_size=3,
feature_clip=5,
flatten=True,
window_along_col='instrument'
)
m6 = M.dl_convert_to_bin.v2(
input_data=m4.data,
features=m3.data,
window_size=3,
feature_clip=5,
flatten=False,
window_along_col='instrument'
)
[2021-07-08 11:19:27.950136] INFO: moduleinvoker: instruments.v2 开始运行..
[2021-07-08 11:19:27.966034] INFO: moduleinvoker: 命中缓存
[2021-07-08 11:19:27.968438] INFO: moduleinvoker: instruments.v2 运行完成[0.018314s].
[2021-07-08 11:19:27.973663] INFO: moduleinvoker: input_features.v1 开始运行..
[2021-07-08 11:19:27.981254] INFO: moduleinvoker: 命中缓存
[2021-07-08 11:19:27.983511] INFO: moduleinvoker: input_features.v1 运行完成[0.009743s].
[2021-07-08 11:19:28.021560] INFO: moduleinvoker: general_feature_extractor.v7 开始运行..
[2021-07-08 11:19:28.027453] INFO: moduleinvoker: 命中缓存
[2021-07-08 11:19:28.028720] INFO: moduleinvoker: general_feature_extractor.v7 运行完成[0.007183s].
[2021-07-08 11:19:28.095616] INFO: moduleinvoker: derived_feature_extractor.v3 开始运行..
[2021-07-08 11:19:28.102308] INFO: moduleinvoker: 命中缓存
[2021-07-08 11:19:28.104209] INFO: moduleinvoker: derived_feature_extractor.v3 运行完成[0.0086s].
[2021-07-08 11:19:28.185565] INFO: moduleinvoker: dl_convert_to_bin.v2 开始运行..
[2021-07-08 11:19:28.191787] INFO: moduleinvoker: 命中缓存
[2021-07-08 11:19:28.193318] INFO: moduleinvoker: dl_convert_to_bin.v2 运行完成[0.007779s].
[2021-07-08 11:19:28.199969] INFO: moduleinvoker: dl_convert_to_bin.v2 开始运行..
[2021-07-08 11:19:28.207160] INFO: moduleinvoker: 命中缓存
[2021-07-08 11:19:28.209201] INFO: moduleinvoker: dl_convert_to_bin.v2 运行完成[0.00925s].
[2021-07-08 11:19:28.217331] INFO: moduleinvoker: dl_convert_to_bin.v2 开始运行..
[2021-07-08 11:19:28.224940] INFO: moduleinvoker: 命中缓存
[2021-07-08 11:19:28.226897] INFO: moduleinvoker: dl_convert_to_bin.v2 运行完成[0.009583s].
时序模型,CNN LSTM RNN 之前时间的因子对后面预测有更多信息