{"description":"实验创建于2017/8/26","graph":{"edges":[{"to_node_id":"-322:features","from_node_id":"-331:data"},{"to_node_id":"-322:instruments","from_node_id":"-312:data"},{"to_node_id":"-1136:input_data","from_node_id":"-322:data"},{"to_node_id":"-322:user_functions","from_node_id":"-932:functions"},{"to_node_id":"-932:input_functions","from_node_id":"-1111:functions"},{"to_node_id":"-1111:input_functions","from_node_id":"-2016:functions"},{"to_node_id":"-1136:features","from_node_id":"-2149:data"},{"to_node_id":"-2016:input_functions","from_node_id":"-584:functions"}],"nodes":[{"node_id":"-331","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"_c = close\n_o = open\n_v = volume\n# _bmc = bar1m_000905_HIX__close\n# _bmo = bar1m_000905_HIX__open\n_ret = ret_sim(_c, _o)\n_rk1 = _ret.loc[93500:100000]\n_rk2 = _ret.loc[110000:113000]\n_rk3 = _ret.loc[143000:145700]\n# _bm_ret = ret_sim(_bmc, _bmo)\n\n# 收益方差\nRVar = RVar(_ret)\n\n# 收益偏度\nRSkew = RSkew(_ret, RVar)\n\n# # 收益峰度\nRKurt = RKurt(_ret, RVar)\n\n# # 成交量占比\nvolume_ratio_1 = _v.loc[93500:100000].sum() / _v.sum()\nvolume_ratio_2 = _v.loc[100100:103000].sum() / _v.sum()\nvolume_ratio_3 = _v.loc[103100:110000].sum() / _v.sum()\nvolume_ratio_4 = _v.loc[110100:113000].sum() / _v.sum()\nvolume_ratio_5 = _v.loc[143000:145700].sum() / _v.sum()\n\n# 量价相关性\n_Volume = _v\n_Price = _c\n_corr= _Volume.corr(_Price, method='pearson')\ncorr_PV = where(np.isnan(_corr), 0, _corr)\n\n# 资金流入因子\n_diff_close = _c.diff().fillna(0)\n# Amount = amount.sum()\nflowIn_oneday = _v.mul(_c).mul(_diff_close).div((_diff_close).abs()).fillna(0).sum()\n\n# 趋势强度因子\ntrend_str = where(_diff_close.iloc[1:].abs().sum()==0, 1, _c.iloc[-1] - _c.iloc[0] / (_diff_close.iloc[1:].abs().sum()))\n\n# 改进反转因子\ninverse_plus = (_c.iloc[-1] - _c.loc[100000]) / _c.loc[100000]\n\n# 日内动量因子\ndaily_mom_1 = (_c.loc[103000] - _c.loc[93500]) / _c.loc[93500]\ndaily_mom_2 = (_c.loc[110000] - _c.loc[93500]) / _c.loc[93500]\ndaily_mom_3 = (_c.loc[143000] - _c.loc[93500]) / _c.loc[93500]\ndaily_mom_4 = (_c.loc[145700] - _c.loc[93500]) / _c.loc[93500]\n\n\n\n\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-331"}],"output_ports":[{"name":"data","node_id":"-331"}],"cacheable":true,"seq_num":1,"comment":"","comment_collapsed":true},{"node_id":"-312","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2014-03-03","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2021-12-31","type":"Literal","bound_global_parameter":null},{"name":"market","value":"CN_STOCK_A","type":"Literal","bound_global_parameter":null},{"name":"instrument_list","value":"000001.SZA\n000002.SZA\n000005.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":"-312"}],"output_ports":[{"name":"data","node_id":"-312"}],"cacheable":true,"seq_num":2,"comment":"","comment_collapsed":true},{"node_id":"-322","module_id":"BigQuantSpace.feature_extractor_1m.feature_extractor_1m-v1","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":"20","type":"Literal","bound_global_parameter":null},{"name":"workers","value":2,"type":"Literal","bound_global_parameter":null},{"name":"parallel_mode","value":"测试","type":"Literal","bound_global_parameter":null},{"name":"table_1m","value":"level2_bar1m_CN_STOCK_A","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"-322"},{"name":"features","node_id":"-322"},{"name":"user_functions","node_id":"-322"}],"output_ports":[{"name":"data","node_id":"-322"}],"cacheable":true,"seq_num":3,"comment":"","comment_collapsed":true},{"node_id":"-932","module_id":"BigQuantSpace.feature_extractor_user_function.feature_extractor_user_function-v1","parameters":[{"name":"name","value":"RVar","type":"Literal","bound_global_parameter":null},{"name":"func","value":"def bigquant_run(df, ret):\n return np.power(ret, 2).sum()\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_functions","node_id":"-932"}],"output_ports":[{"name":"functions","node_id":"-932"}],"cacheable":false,"seq_num":5,"comment":"","comment_collapsed":true},{"node_id":"-1111","module_id":"BigQuantSpace.feature_extractor_user_function.feature_extractor_user_function-v1","parameters":[{"name":"name","value":"RSkew","type":"Literal","bound_global_parameter":null},{"name":"func","value":"def bigquant_run(df, ret, RVar):\n if RVar == 0:\n result = 0\n else:\n result = (np.power(ret, 3).sum()) * np.sqrt(240) / np.power(RVar, 1.5)\n return result\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_functions","node_id":"-1111"}],"output_ports":[{"name":"functions","node_id":"-1111"}],"cacheable":false,"seq_num":6,"comment":"","comment_collapsed":true},{"node_id":"-2016","module_id":"BigQuantSpace.feature_extractor_user_function.feature_extractor_user_function-v1","parameters":[{"name":"name","value":"RKurt","type":"Literal","bound_global_parameter":null},{"name":"func","value":"def bigquant_run(df, ret, RVar):\n if RVar == 0:\n result = 1\n else:\n result = (np.power(ret, 4).sum()) * (240) / np.power(RVar, 2)\n \n return result\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_functions","node_id":"-2016"}],"output_ports":[{"name":"functions","node_id":"-2016"}],"cacheable":false,"seq_num":4,"comment":"","comment_collapsed":true},{"node_id":"-1136","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 nanmean(df, x_name, N):\n return df.groupby('instrument')[x_name.name].apply(lambda x: x.rolling(N,1).mean())\n\ndef nansum(df, x_name, N):\n return df.groupby('instrument')[x_name.name].apply(lambda x: x.rolling(N,1).sum())\n\nbigquant_run = {\n 'nanmean': nanmean,\n 'nansum': nansum\n}","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_data","node_id":"-1136"},{"name":"features","node_id":"-1136"}],"output_ports":[{"name":"data","node_id":"-1136"}],"cacheable":true,"seq_num":7,"comment":"","comment_collapsed":true},{"node_id":"-2149","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"flowInRatio = nansum(flowIn_oneday, 5) / nansum(Amount, 5)\n\nvolume_ratio_1 = nanmean(volume_ratio_1 , 20)\nvolume_ratio_2 = nanmean(volume_ratio_2 , 20)\nvolume_ratio_3 = nanmean(volume_ratio_3 , 20)\nvolume_ratio_4 = nanmean(volume_ratio_4 , 20)\nvolume_ratio_5 = nanmean(volume_ratio_5 , 20)\n\ncorr_PV = nanmean(corr_PV, 20)\n\ntrend_str_mean5 = nanmean(trend_str, 5)\ntrend_str_mean10 = nanmean(trend_str, 10)\ntrend_str_mean20 = nanmean(trend_str, 20)\n\ninverse_plus = nanmean(inverse_plus, 22)","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-2149"}],"output_ports":[{"name":"data","node_id":"-2149"}],"cacheable":true,"seq_num":8,"comment":"","comment_collapsed":true},{"node_id":"-584","module_id":"BigQuantSpace.feature_extractor_user_function.feature_extractor_user_function-v1","parameters":[{"name":"name","value":"ret_sim","type":"Literal","bound_global_parameter":null},{"name":"func","value":"def bigquant_run(df, close, op):\n res = close.pct_change()\n res.iloc[0] = close.iloc[0] / op.iloc[0] - 1\n return res\n","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_functions","node_id":"-584"}],"output_ports":[{"name":"functions","node_id":"-584"}],"cacheable":false,"seq_num":9,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='-331' Position='8,-279,200,200'/><node_position Node='-312' Position='-319,-281,200,200'/><node_position Node='-322' Position='0,-62.56494903564453,200,200'/><node_position Node='-932' Position='34,-418,200,200'/><node_position Node='-1111' Position='33,-473,200,200'/><node_position Node='-2016' Position='31,-532,200,200'/><node_position Node='-1136' Position='177,100,200,200'/><node_position Node='-2149' Position='323,-62,200,200'/><node_position Node='-584' Position='31.870086669921875,-598.95458984375,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
[2021-07-09 10:23:41.363756] INFO: moduleinvoker: input_features.v1 开始运行..
[2021-07-09 10:23:41.369287] INFO: moduleinvoker: 命中缓存
[2021-07-09 10:23:41.370189] INFO: moduleinvoker: input_features.v1 运行完成[0.006442s].
[2021-07-09 10:23:41.371700] INFO: moduleinvoker: instruments.v2 开始运行..
[2021-07-09 10:23:41.393886] INFO: moduleinvoker: instruments.v2 运行完成[0.022178s].
[2021-07-09 10:23:41.395212] INFO: moduleinvoker: input_features.v1 开始运行..
[2021-07-09 10:23:41.399391] INFO: moduleinvoker: 命中缓存
[2021-07-09 10:23:41.400147] INFO: moduleinvoker: input_features.v1 运行完成[0.004937s].
[2021-07-09 10:23:41.401699] INFO: moduleinvoker: feature_extractor_user_function.v1 运行完成[6.4e-05s].
[2021-07-09 10:23:41.403232] INFO: moduleinvoker: feature_extractor_user_function.v1 运行完成[5.5e-05s].
[2021-07-09 10:23:41.404742] INFO: moduleinvoker: feature_extractor_user_function.v1 运行完成[5e-05s].
[2021-07-09 10:23:41.406261] INFO: moduleinvoker: feature_extractor_user_function.v1 运行完成[5.1e-05s].
[2021-07-09 10:23:41.409702] INFO: moduleinvoker: feature_extractor_1m.v1 开始运行..
[2021-07-09 10:23:41.439889] INFO: 高频特征抽取-分钟到日频: 测试模式运行, ['000002.SZA', '000005.SZA', '000001.SZA']
[2021-07-09 10:23:41.440540] INFO: 高频特征抽取-分钟到日频: parallel_calculate features 3 instruments, 27 features 2 processes_count..
[2021-07-09 10:23:41.441173] INFO: 高频特征抽取-分钟到日频: 开始计算 ... processes_count=2
[2021-07-09 10:23:41.457464] INFO: 高频特征抽取-分钟到日频: 计算中: 0%| | 0/3 [00:00, ?it/s]
[2021-07-09 10:23:47.180037] INFO: 高频特征抽取-分钟到日频: 计算中: 33%|########## | 1/3 [00:05<00:11, 5.72s/it]
[2021-07-09 10:23:47.575700] INFO: 高频特征抽取-分钟到日频: 计算中: 67%|#################### | 2/3 [00:06<00:04, 4.12s/it]
[2021-07-09 10:23:49.740503] INFO: 高频特征抽取-分钟到日频: 计算中: 100%|##############################| 3/3 [00:08<00:00, 3.54s/it]
[2021-07-09 10:23:49.815394] INFO: 高频特征抽取-分钟到日频: extracted chunk 3/3 instruments, (729, 18).
[2021-07-09 10:23:49.816281] INFO: 高频特征抽取-分钟到日频: merge result .......
[2021-07-09 10:23:49.887599] INFO: 高频特征抽取-分钟到日频: extracted 3/3 instruments, (729, 18)
[2021-07-09 10:23:49.890967] INFO: moduleinvoker: feature_extractor_1m.v1 运行完成[8.481253s].
[2021-07-09 10:23:49.894607] INFO: moduleinvoker: derived_feature_extractor.v3 开始运行..
[2021-07-09 10:23:49.924946] WARNING: derived_feature_extractor: 特征 flowInRatio = nansum(flowIn_oneday, 5) / nansum(Amount, 5),找不到依赖的列:Amount
[2021-07-09 10:23:49.931005] INFO: derived_feature_extractor: 提取失败 flowInRatio = nansum(flowIn_oneday, 5) / nansum(Amount, 5): Unknown Amount
[2021-07-09 10:23:49.934398] INFO: derived_feature_extractor: 提取完成 volume_ratio_1 = nanmean(volume_ratio_1 , 20), 0.003s
[2021-07-09 10:23:49.937715] INFO: derived_feature_extractor: 提取完成 volume_ratio_2 = nanmean(volume_ratio_2 , 20), 0.003s
[2021-07-09 10:23:49.941047] INFO: derived_feature_extractor: 提取完成 volume_ratio_3 = nanmean(volume_ratio_3 , 20), 0.003s
[2021-07-09 10:23:49.944412] INFO: derived_feature_extractor: 提取完成 volume_ratio_4 = nanmean(volume_ratio_4 , 20), 0.003s
[2021-07-09 10:23:49.947722] INFO: derived_feature_extractor: 提取完成 volume_ratio_5 = nanmean(volume_ratio_5 , 20), 0.003s
[2021-07-09 10:23:49.951007] INFO: derived_feature_extractor: 提取完成 corr_PV = nanmean(corr_PV, 20), 0.003s
[2021-07-09 10:23:49.954579] INFO: derived_feature_extractor: 提取完成 trend_str_mean5 = nanmean(trend_str, 5), 0.003s
[2021-07-09 10:23:49.958012] INFO: derived_feature_extractor: 提取完成 trend_str_mean10 = nanmean(trend_str, 10), 0.003s
[2021-07-09 10:23:49.961491] INFO: derived_feature_extractor: 提取完成 trend_str_mean20 = nanmean(trend_str, 20), 0.003s
[2021-07-09 10:23:49.964768] INFO: derived_feature_extractor: 提取完成 inverse_plus = nanmean(inverse_plus, 22), 0.003s
[2021-07-09 10:23:49.990173] INFO: derived_feature_extractor: /data, 729
[2021-07-09 10:23:50.028908] INFO: moduleinvoker: derived_feature_extractor.v3 运行完成[0.1343s].