{"description":"实验创建于2022/7/29","graph":{"edges":[{"to_node_id":"-124:instruments","from_node_id":"-111:data"},{"to_node_id":"-124:features","from_node_id":"-119:data"},{"to_node_id":"-45:input_1","from_node_id":"-124:data"}],"nodes":[{"node_id":"-111","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2018-01-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2020-01-01","type":"Literal","bound_global_parameter":null},{"name":"market","value":"CN_STOCK_A","type":"Literal","bound_global_parameter":null},{"name":"instrument_list","value":"000002.SZA\n000063.SZA","type":"Literal","bound_global_parameter":null},{"name":"max_count","value":0,"type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"rolling_conf","node_id":"-111"}],"output_ports":[{"name":"data","node_id":"-111"}],"cacheable":true,"seq_num":1,"comment":"","comment_collapsed":true},{"node_id":"-119","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\nvolume_0\nclose_0\nclose_1\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-119"}],"output_ports":[{"name":"data","node_id":"-119"}],"cacheable":true,"seq_num":2,"comment":"","comment_collapsed":true},{"node_id":"-124","module_id":"BigQuantSpace.general_feature_extractor.general_feature_extractor-v7","parameters":[{"name":"start_date","value":"","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"","type":"Literal","bound_global_parameter":null},{"name":"before_start_days","value":90,"type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"-124"},{"name":"features","node_id":"-124"}],"output_ports":[{"name":"data","node_id":"-124"}],"cacheable":true,"seq_num":3,"comment":"","comment_collapsed":true},{"node_id":"-45","module_id":"BigQuantSpace.cached.cached-v3","parameters":[{"name":"run","value":"# Python 代码入口函数,input_1/2/3 对应三个输入端,data_1/2/3 对应三个输出端\ndef bigquant_run(input_1, input_2, input_3):\n df = input_1.read()\n result = dict()\n sd = 50\n ed = 20\n def _get_max_vols(x2):\n x = x2.copy()\n x.sort_values(\"date\", ascending=True, inplace=True)\n code = x.instrument.values[0]\n print(code)\n x[\"shift_date\"] = x.date.shift(ed)\n x[\"shift_vol\"] = x.volume_0.shift(ed)\n x.dropna(inplace=True)\n max_vol_df = dict()\n k = 0\n for i in x.rolling(window=30):\n if len(i)<30:\n continue\n _i = i.sort_values(\"shift_vol\", ascending=False)\n max_vol = _i.iloc[0,:]\n i[\"max_date\"] = max_vol[\"shift_date\"]\n i[\"max_vol\"] = max_vol[\"shift_vol\"]\n max_vol_df[str(k)] = i.iloc[-1,:]\n k = k+1\n result[code] = pd.DataFrame(max_vol_df).T\n df.groupby(\"instrument\").apply(_get_max_vols)\n \n res_df = pd.DataFrame()\n for k,v in result.items():\n res_df = pd.concat([res_df, v], axis=0)\n \n res_df.reset_index(drop=True, inplace=True)\n data_1 = DataSource.write_df(res_df)\n return Outputs(data_1=data_1, data_2=None, data_3=None)\n","type":"Literal","bound_global_parameter":null},{"name":"post_run","value":"# 后处理函数,可选。输入是主函数的输出,可以在这里对数据做处理,或者返回更友好的outputs数据格式。此函数输出不会被缓存。\ndef bigquant_run(outputs):\n return outputs\n","type":"Literal","bound_global_parameter":null},{"name":"input_ports","value":"","type":"Literal","bound_global_parameter":null},{"name":"params","value":"{}","type":"Literal","bound_global_parameter":null},{"name":"output_ports","value":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_1","node_id":"-45"},{"name":"input_2","node_id":"-45"},{"name":"input_3","node_id":"-45"}],"output_ports":[{"name":"data_1","node_id":"-45"},{"name":"data_2","node_id":"-45"},{"name":"data_3","node_id":"-45"}],"cacheable":true,"seq_num":4,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='-111' Position='115,153,200,200'/><node_position Node='-119' Position='516,153,200,200'/><node_position Node='-124' Position='310,282,200,200'/><node_position Node='-45' Position='306,394,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
[2022-07-29 18:31:10.511553] INFO: moduleinvoker: instruments.v2 开始运行..
[2022-07-29 18:31:10.540270] INFO: moduleinvoker: 命中缓存
[2022-07-29 18:31:10.542814] INFO: moduleinvoker: instruments.v2 运行完成[0.030848s].
[2022-07-29 18:31:10.547865] INFO: moduleinvoker: input_features.v1 开始运行..
[2022-07-29 18:31:10.625661] INFO: moduleinvoker: input_features.v1 运行完成[0.077801s].
[2022-07-29 18:31:10.641593] INFO: moduleinvoker: general_feature_extractor.v7 开始运行..
[2022-07-29 18:31:12.723003] INFO: 基础特征抽取: 年份 2017, 特征行数=120
[2022-07-29 18:31:17.848163] INFO: 基础特征抽取: 年份 2018, 特征行数=447
[2022-07-29 18:31:22.266564] INFO: 基础特征抽取: 年份 2019, 特征行数=488
[2022-07-29 18:31:25.018501] INFO: 基础特征抽取: 年份 2020, 特征行数=0
[2022-07-29 18:31:25.056939] INFO: 基础特征抽取: 总行数: 1055
[2022-07-29 18:31:25.062351] INFO: moduleinvoker: general_feature_extractor.v7 运行完成[14.420754s].
[2022-07-29 18:31:25.095295] INFO: moduleinvoker: cached.v3 开始运行..
[2022-07-29 18:31:28.326553] INFO: moduleinvoker: cached.v3 运行完成[3.231262s].