{"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":"-322:user_functions","from_node_id":"-421:functions"},{"to_node_id":"-421:input_functions","from_node_id":"-932:functions"}],"nodes":[{"node_id":"-331","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"_ret_log = np.log(close.pct_change().fillna(method='bfill'))\n_ret = close.pct_change().fillna(method='bfill')\n_rk1 = _ret.loc[93500:100000]\n_rk2 = _ret.loc[110000:113000]\n_rk3 = _ret.loc[143000:145700]\n_bm_ret = (bar1m_000905_HIX__close).pct_change().fillna(method='bfill')\n\n# 高频波动- 收益波动因子\nret_vol = np.power(RVar(_ret), 0.5)\n\n# 高频特征波动-特质波动因子\n_spec_ret = residual_return(_ret, _bm_ret)\nspec_ret_vol = np.power(RVar(_spec_ret), 0.5)\n\n# 高频系统波动-系统波动因子\nsys_vol = np.power(np.power(_ret - _spec_ret, 2).sum(), 0.5)\n\n# 高频特异度-特异度因子\nspeci_ratio = where(RVar(_ret)==0, 1, np.power(_spec_ret, 2).sum() / RVar(_ret))\n\n# 高频上行波动-上行波动因子\nup_vol = np.sqrt(np.power(_ret*where(_ret>0, 1, 0), 2).sum())\n\n# 高频下行波动-下行波动因子\ndown_vol = np.sqrt(np.power(_ret*where(_ret<0, 1, 0), 2).sum())\n\n# 上行波动占比因子\n#up_vol_ratio = where(RVar(_ret)==0, 1, up_vol / RVar(_ret)) # hcd \nup_vol_ratio = where(RVar(_ret)==0, 1, np.power(up_vol,2) / RVar(_ret)) #sst\n\n\n# 下行波动占比因子\n#down_vol_ratio = where(RVar(_ret)==0, 1, down_vol / RVar(_ret)) #hcd\ndown_vol_ratio = where(RVar(_ret)==0, 1, np.power(down_vol,2) / RVar(_ret)) #sst\n\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":"2020-03-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2020-05-01","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":"-421","module_id":"BigQuantSpace.feature_extractor_user_function.feature_extractor_user_function-v1","parameters":[{"name":"name","value":"residual_return","type":"Literal","bound_global_parameter":null},{"name":"func","value":"def bigquant_run(df, ret, bm_ret):\n from sklearn import linear_model\n idx = ret.index\n ret = np.array(ret.fillna(0)).reshape(-1,1)\n bm_ret = np.array(bm_ret.fillna(0)).reshape(-1,1)\n \n model = linear_model.LinearRegression().fit(ret, bm_ret)\n res = ret - model.intercept_ - bm_ret*model.coef_\n \n res = pd.Series(res.ravel(), index=idx)\n return res","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_functions","node_id":"-421"}],"output_ports":[{"name":"functions","node_id":"-421"}],"cacheable":false,"seq_num":4,"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_layout":"<node_postions><node_position Node='-331' Position='73.10943603515625,-2,200,200'/><node_position Node='-312' Position='-256,-4,200,200'/><node_position Node='-322' Position='68,214.75791931152344,200,200'/><node_position Node='-421' Position='408,-1,200,200'/><node_position Node='-932' Position='229.68304443359375,-117.67169952392578,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
[2021-07-05 20:39:14.151365] INFO: moduleinvoker: input_features.v1 开始运行..
[2021-07-05 20:39:14.260342] INFO: moduleinvoker: input_features.v1 运行完成[0.108968s].
[2021-07-05 20:39:14.265422] INFO: moduleinvoker: instruments.v2 开始运行..
[2021-07-05 20:39:14.364031] INFO: moduleinvoker: instruments.v2 运行完成[0.098613s].
[2021-07-05 20:39:14.481256] INFO: moduleinvoker: feature_extractor_user_function.v1 运行完成[0.00015s].
[2021-07-05 20:39:14.484088] INFO: moduleinvoker: feature_extractor_user_function.v1 运行完成[0.000108s].
[2021-07-05 20:39:14.687934] INFO: moduleinvoker: feature_extractor_1m.v1 开始运行..
[2021-07-05 20:39:14.846062] INFO: 高频特征抽取-分钟到日频: 测试模式运行, ['000001.SZA', '000005.SZA', '000002.SZA']
[2021-07-05 20:39:14.847752] INFO: fe1m_utils: extract chunk 3 instruments, 15 features ..
[2021-07-05 20:39:15.120112] INFO: fe1m_utils: extract chunk 3 instruments, n_jobs=30=(20+40)/2, 并行=False ..
[2021-07-05 20:39:20.308208] INFO: fe1m_utils: extracted chunk 3/3 instruments, (174, 10).
[2021-07-05 20:39:20.442266] INFO: 高频特征抽取-分钟到日频: extracted 3/3 instruments, (174, 10)
[2021-07-05 20:39:20.449350] INFO: moduleinvoker: feature_extractor_1m.v1 运行完成[5.761415s].