{"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":"2021-10-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2021-12-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":true,"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":"get_ret(close_0, 15)\ncut(get_ret(close_0, 15), 3)\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":"0","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 _ret(df, factor , N):\n # 单支票求收益率\n df['ret'] = factor / factor.shift(N) -1 # 这里的factor 是一个pandas的Series对象\n return df \n \ndef get_ret(df, factor, N):\n # 全市场求收益率, 按标的进行分组\n ret_df = df.groupby('instrument').apply(_ret, factor=factor, N=N).reset_index()\n return ret_df['ret'] # 求一个表达式的数值,应该返回一个Series对象\n\ndef _cut(df, factor, Bins):\n # 单个交易日横截面进行cut\n df['label'] = pd.cut(factor.rank(pct=True), bins=Bins, labels=False) / (Bins-1)\n return df\n\ndef cut(df, factor, Bins=3):\n # 全部交易日进行cut, 按date进行分组\n label_df = df.groupby('date').apply(_cut, factor=factor, Bins=Bins).reset_index() \n return label_df['label'] # 求一个表达式的数值,应该返回一个Series对象\n\n\n# 因为这俩表达式是我们新自定义的表达式,因此需要声明,以便在输入特征列表可使用\nbigquant_run = {\n 'cut':cut, \n 'get_ret':get_ret,\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":true,"seq_num":16,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-8' Position='9.754318237304688,-176.0166630744934,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-24' Position='320.9460754394531,-181.9390823841095,200,200'/><node_position Node='-215' Position='107.2994384765625,-51.52054786682129,200,200'/><node_position Node='-222' Position='80.18855285644531,36.300506591796875,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
[2021-12-23 22:14:08.597977] INFO: moduleinvoker: instruments.v2 开始运行..
[2021-12-23 22:14:08.702776] INFO: moduleinvoker: instruments.v2 运行完成[0.104805s].
[2021-12-23 22:14:08.707913] INFO: moduleinvoker: input_features.v1 开始运行..
[2021-12-23 22:14:08.722589] INFO: moduleinvoker: 命中缓存
[2021-12-23 22:14:08.726591] INFO: moduleinvoker: input_features.v1 运行完成[0.018676s].
[2021-12-23 22:14:08.883826] INFO: moduleinvoker: general_feature_extractor.v7 开始运行..
[2021-12-23 22:14:50.355414] INFO: 基础特征抽取: 年份 2021, 特征行数=177232
[2021-12-23 22:14:50.468746] INFO: 基础特征抽取: 总行数: 177232
[2021-12-23 22:14:50.475067] INFO: moduleinvoker: general_feature_extractor.v7 运行完成[41.591242s].
[2021-12-23 22:14:50.487708] INFO: moduleinvoker: derived_feature_extractor.v3 开始运行..
[2021-12-23 22:15:04.236769] INFO: derived_feature_extractor: 提取完成 get_ret(close_0, 15), 13.356s
[2021-12-23 22:15:21.544636] INFO: derived_feature_extractor: 提取完成 cut(get_ret(close_0, 15), 3), 17.306s
[2021-12-23 22:15:22.157552] INFO: derived_feature_extractor: /y_2021, 177232
[2021-12-23 22:15:22.277948] INFO: moduleinvoker: derived_feature_extractor.v3 运行完成[31.790232s].