{"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"}],"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(np.power(_ret, 2).sum(), 0.5)\n\n# 特质波动因子\n_spec_ret = residual_return(_ret, _bm_ret)\nspec_ret_vol = np.power(np.power(_spec_ret, 2).sum(), 0.5)\n\n# 系统波动因子\nsys_vol = np.power(np.power(_ret - _spec_ret, 2).sum(), 0.5)\n\n# 特异度因子\nspeci_ratio = np.power(_spec_ret, 2).sum() / np.power(_ret, 2).sum() \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# 上行波动占比因子\nup_vol_ratio = up_vol / (np.power(_ret, 2).sum())\n\n# 下行波动占比因子\ndown_vol_ratio = down_vol / (np.power(_ret, 2).sum())\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_layout":"<node_postions><node_position Node='-331' Position='74,-2.5566024780273438,200,200'/><node_position Node='-312' Position='-256,-4,200,200'/><node_position Node='-322' Position='68,213,200,200'/><node_position Node='-421' Position='408.443359375,-1,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
[2021-06-28 16:56:35.012975] INFO: moduleinvoker: input_features.v1 开始运行..
[2021-06-28 16:56:35.213364] INFO: moduleinvoker: input_features.v1 运行完成[0.200391s].
[2021-06-28 16:56:35.216150] INFO: moduleinvoker: instruments.v2 开始运行..
[2021-06-28 16:56:35.221502] INFO: moduleinvoker: 命中缓存
[2021-06-28 16:56:35.222748] INFO: moduleinvoker: instruments.v2 运行完成[0.006597s].
[2021-06-28 16:56:35.225317] INFO: moduleinvoker: feature_extractor_user_function.v1 运行完成[0.000127s].
[2021-06-28 16:56:35.230500] INFO: moduleinvoker: feature_extractor_1m.v1 开始运行..
[2021-06-28 16:56:35.248717] INFO: 高频特征抽取-分钟到日频: 测试模式运行, ['000001.SZA', '000005.SZA', '000002.SZA']
[2021-06-28 16:56:35.250694] INFO: fe1m_utils: extract chunk 3 instruments, 15 features ..
[2021-06-28 16:56:35.820561] INFO: fe1m_utils: extract chunk 3 instruments, n_jobs=30=(20+40)/2, 并行=False ..
[2021-06-28 16:56:39.082559] INFO: fe1m_utils: extracted chunk 3/3 instruments, (174, 10).
[2021-06-28 16:56:39.245927] INFO: 高频特征抽取-分钟到日频: extracted 3/3 instruments, (174, 10)
[2021-06-28 16:56:39.252510] INFO: moduleinvoker: feature_extractor_1m.v1 运行完成[4.022011s].