{"description":"实验创建于2017/8/26","graph":{"edges":[{"to_node_id":"-215:instruments","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-8:data"},{"to_node_id":"-215:features","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"to_node_id":"-222:features","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"to_node_id":"-222:input_data","from_node_id":"-215:data"}],"nodes":[{"node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-8","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2014-01-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2015-01-01","type":"Literal","bound_global_parameter":null},{"name":"market","value":"CN_STOCK_A","type":"Literal","bound_global_parameter":null},{"name":"instrument_list","value":"","type":"Literal","bound_global_parameter":null},{"name":"max_count","value":"0","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"rolling_conf","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-8"}],"output_ports":[{"name":"data","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-8"}],"cacheable":false,"seq_num":1,"comment":"","comment_collapsed":true},{"node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"# #号开始的表示注释\n# 多个特征,每行一个,可以包含基础特征和衍生特征\nopen = open_0 # 表示个股开盘价\nclose = close_0 # 个股收盘价\nbenchmark_open = cal_bm_open() # 基准指数开盘价\nbenchmark_close = cal_bm_close() # 基准指数收盘价\naddx(close_0,open_0) # 自定义一个表达式\n\n# 构建我们希望得到的衍生因子\nsum(where((close/open-benchmark_close/benchmark_open)<0 , (close/open-benchmark_close/benchmark_open)**2, 0),5)\n\n\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24"}],"output_ports":[{"name":"data","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24"}],"cacheable":true,"seq_num":3,"comment":"","comment_collapsed":true},{"node_id":"-215","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":"-215"},{"name":"features","node_id":"-215"}],"output_ports":[{"name":"data","node_id":"-215"}],"cacheable":true,"seq_num":15,"comment":"","comment_collapsed":true},{"node_id":"-222","module_id":"BigQuantSpace.derived_feature_extractor.derived_feature_extractor-v3","parameters":[{"name":"date_col","value":"date","type":"Literal","bound_global_parameter":null},{"name":"instrument_col","value":"instrument","type":"Literal","bound_global_parameter":null},{"name":"drop_na","value":"False","type":"Literal","bound_global_parameter":null},{"name":"remove_extra_columns","value":"False","type":"Literal","bound_global_parameter":null},{"name":"user_functions","value":"def cal_bm_open(df):\n bm_df = DataSource('bar1d_index_CN_STOCK_A').read(instruments=['000300.HIX'])\n bm_df.rename(columns={'open':'benchmark_open'}, inplace=True)\n merge_df = pd.merge(df, bm_df[['date','benchmark_open']], on='date', how='left')\n return merge_df['benchmark_open']\n\ndef cal_bm_close(df):\n bm_df = DataSource('bar1d_index_CN_STOCK_A').read(instruments=['000300.HIX'])\n bm_df.rename(columns={'close':'benchmark_close'}, inplace=True)\n merge_df = pd.merge(df, bm_df[['date','benchmark_close']], on='date', how='left')\n return merge_df['benchmark_close']\n\ndef addx(df, x1, x2):\n return x1+x2\n\nbigquant_run = {\n 'cal_bm_open': cal_bm_open,\n 'cal_bm_close': cal_bm_close,\n 'addx':addx\n}\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_data","node_id":"-222"},{"name":"features","node_id":"-222"}],"output_ports":[{"name":"data","node_id":"-222"}],"cacheable":false,"seq_num":16,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-8' Position='127,-10,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-24' Position='610.25244140625,4.501630783081055,200,200'/><node_position Node='-215' Position='259,156,200,200'/><node_position Node='-222' Position='272,258,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
[2021-10-15 14:52:59.145531] INFO: moduleinvoker: instruments.v2 开始运行..
[2021-10-15 14:52:59.215601] INFO: moduleinvoker: instruments.v2 运行完成[0.070064s].
[2021-10-15 14:52:59.221272] INFO: moduleinvoker: input_features.v1 开始运行..
[2021-10-15 14:52:59.256378] INFO: moduleinvoker: input_features.v1 运行完成[0.035112s].
[2021-10-15 14:52:59.268522] INFO: moduleinvoker: general_feature_extractor.v7 开始运行..
[2021-10-15 14:53:00.856523] INFO: 基础特征抽取: 年份 2013, 特征行数=143272
[2021-10-15 14:53:03.182786] INFO: 基础特征抽取: 年份 2014, 特征行数=569948
[2021-10-15 14:53:04.085312] INFO: 基础特征抽取: 年份 2015, 特征行数=0
[2021-10-15 14:53:04.143589] INFO: 基础特征抽取: 总行数: 713220
[2021-10-15 14:53:04.148107] INFO: moduleinvoker: general_feature_extractor.v7 运行完成[4.879633s].
[2021-10-15 14:53:04.155290] INFO: moduleinvoker: derived_feature_extractor.v3 开始运行..
[2021-10-15 14:53:05.488887] INFO: derived_feature_extractor: 提取完成 open = open_0 # 表示个股开盘价, 0.002s
[2021-10-15 14:53:05.492307] INFO: derived_feature_extractor: 提取完成 close = close_0 # 个股收盘价, 0.002s
[2021-10-15 14:53:05.910127] INFO: derived_feature_extractor: 提取完成 benchmark_open = cal_bm_open() # 基准指数开盘价, 0.416s
[2021-10-15 14:53:06.294569] INFO: derived_feature_extractor: 提取完成 benchmark_close = cal_bm_close() # 基准指数收盘价, 0.383s
[2021-10-15 14:53:06.301027] INFO: derived_feature_extractor: 提取完成 addx(close_0,open_0) # 自定义一个表达式, 0.003s
[2021-10-15 14:53:06.994624] INFO: derived_feature_extractor: 提取完成 sum(where((close/open-benchmark_close/benchmark_open)<0 , (close/open-benchmark_close/benchmark_open)**2, 0),5), 0.692s
[2021-10-15 14:53:07.327597] INFO: derived_feature_extractor: /y_2013, 143272
[2021-10-15 14:53:08.374782] INFO: derived_feature_extractor: /y_2014, 569948
[2021-10-15 14:53:08.618967] INFO: moduleinvoker: derived_feature_extractor.v3 运行完成[4.463658s].