{"Description":"实验创建于2018/1/23","Summary":"","Graph":{"EdgesInternal":[{"DestinationInputPortId":"-38:instruments","SourceOutputPortId":"-4129:data"},{"DestinationInputPortId":"-38:features","SourceOutputPortId":"-315:data"},{"DestinationInputPortId":"-52:features","SourceOutputPortId":"-315:data"},{"DestinationInputPortId":"-45:features","SourceOutputPortId":"-31:data"},{"DestinationInputPortId":"-45:input_data","SourceOutputPortId":"-38:data"},{"DestinationInputPortId":"-52:input_data","SourceOutputPortId":"-45:data"}],"ModuleNodes":[{"Id":"-4129","ModuleId":"BigQuantSpace.instruments.instruments-v2","ModuleParameters":[{"Name":"start_date","Value":"2017-01-01","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"end_date","Value":"2018-01-01","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"market","Value":"CN_STOCK_A","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"instrument_list","Value":"600000.SHA\n600010.SHA\n600015.SHA\n600016.SHA\n600018.SHA\n600028.SHA\n600029.SHA\n600030.SHA\n600036.SHA\n600048.SHA\n\n ","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"max_count","Value":0,"ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"rolling_conf","NodeId":"-4129"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-4129","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":1,"IsPartOfPartialRun":null,"Comment":"","CommentCollapsed":true},{"Id":"-315","ModuleId":"BigQuantSpace.input_features.input_features-v1","ModuleParameters":[{"Name":"features","Value":"return_5\nsum(mf_net_amount_l_0, 5)\nclose_0\nmarket_cap_float_0\nclose_0/close_5-1\n\n \n","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features_ds","NodeId":"-315"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-315","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":2,"IsPartOfPartialRun":null,"Comment":"","CommentCollapsed":true},{"Id":"-31","ModuleId":"BigQuantSpace.input_features.input_features-v1","ModuleParameters":[{"Name":"features","Value":"relative_ret(close_0)","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features_ds","NodeId":"-31"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-31","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":4,"IsPartOfPartialRun":null,"Comment":"","CommentCollapsed":true},{"Id":"-38","ModuleId":"BigQuantSpace.general_feature_extractor.general_feature_extractor-v7","ModuleParameters":[{"Name":"start_date","Value":"","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"end_date","Value":"","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"before_start_days","Value":"","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"instruments","NodeId":"-38"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features","NodeId":"-38"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-38","OutputType":null}],"UsePreviousResults":false,"moduleIdForCode":7,"Comment":"","CommentCollapsed":true},{"Id":"-45","ModuleId":"BigQuantSpace.derived_feature_extractor.derived_feature_extractor-v3","ModuleParameters":[{"Name":"date_col","Value":"date","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"instrument_col","Value":"instrument","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"user_functions","Value":"def calcu_relative_ret(df):\n # 先获取中证800指数数据\n start_date = min(m7.data.read_df().date).strftime('%Y-%m-%d')\n end_date = max(m7.data.read_df().date).strftime('%Y-%m-%d')\n hs800_df = D.history_data(\n '000906.SHA',\n start_date=(pd.to_datetime(start_date) - datetime.timedelta(days=10)).strftime('%Y-%m-%d'), # 多取几天的数据\n end_date=end_date)[['date', 'close']].rename(columns={'close': 'hs800_close'})\n \n # 与个股数据合并\n df = df[['date', 'close_0']].reset_index().merge(hs800_df, on='date', how='left').set_index('index')\n \n # 返回超额收益率\n return df['close_0'].pct_change() - df['hs800_close'].pct_change()\n\n\n# 按股票代码groupby计算个股超额收益率数据\ndef relative_ret(df, close_0):\n return df.groupby('instrument', group_keys=False).apply(calcu_relative_ret)\n\n\nbigquant_run = {\n 'relative_ret': relative_ret\n}\n\n","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"input_data","NodeId":"-45"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features","NodeId":"-45"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-45","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":8,"Comment":"在衍生特征里配置自定义函数就可以了,也可以覆盖同名的预定义函数","CommentCollapsed":true},{"Id":"-52","ModuleId":"BigQuantSpace.derived_feature_extractor.derived_feature_extractor-v3","ModuleParameters":[{"Name":"date_col","Value":"date","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"instrument_col","Value":"instrument","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"user_functions","Value":"{}","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"input_data","NodeId":"-52"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features","NodeId":"-52"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-52","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":9,"Comment":"","CommentCollapsed":true}],"SerializedClientData":"<?xml version='1.0' encoding='utf-16'?><DataV1 xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><Meta /><NodePositions><NodePosition Node='-4129' Position='265,658,200,200'/><NodePosition Node='-315' Position='617,661,200,200'/><NodePosition Node='-31' Position='730,774,200,200'/><NodePosition Node='-38' Position='419,762,200,200'/><NodePosition Node='-45' Position='551,862,200,200'/><NodePosition Node='-52' Position='621,950,200,200'/></NodePositions><NodeGroups /></DataV1>"},"IsDraft":true,"ParentExperimentId":null,"WebService":{"IsWebServiceExperiment":false,"Inputs":[],"Outputs":[],"Parameters":[{"Name":"交易日期","Value":"","ParameterDefinition":{"Name":"交易日期","FriendlyName":"交易日期","DefaultValue":"","ParameterType":"String","HasDefaultValue":true,"IsOptional":true,"ParameterRules":[],"HasRules":false,"MarkupType":0,"CredentialDescriptor":null}}],"WebServiceGroupId":null,"SerializedClientData":"<?xml version='1.0' encoding='utf-16'?><DataV1 xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><Meta /><NodePositions></NodePositions><NodeGroups /></DataV1>"},"DisableNodesUpdate":false,"Category":"user","Tags":[],"IsPartialRun":true}
[2018-07-21 09:07:06.514970] INFO: bigquant: instruments.v2 开始运行..
[2018-07-21 09:07:06.528198] INFO: bigquant: 命中缓存
[2018-07-21 09:07:06.529552] INFO: bigquant: instruments.v2 运行完成[0.014616s].
[2018-07-21 09:07:06.535163] INFO: bigquant: input_features.v1 开始运行..
[2018-07-21 09:07:06.586750] INFO: bigquant: 命中缓存
[2018-07-21 09:07:06.588032] INFO: bigquant: input_features.v1 运行完成[0.052862s].
[2018-07-21 09:07:06.597259] INFO: bigquant: general_feature_extractor.v7 开始运行..
[2018-07-21 09:07:08.381895] INFO: 基础特征抽取: 年份 2017, 特征行数=2434
[2018-07-21 09:07:09.516820] INFO: 基础特征抽取: 年份 2018, 特征行数=0
[2018-07-21 09:07:09.525082] INFO: 基础特征抽取: 总行数: 2434
[2018-07-21 09:07:09.526209] INFO: bigquant: general_feature_extractor.v7 运行完成[2.92896s].
[2018-07-21 09:07:09.529049] INFO: bigquant: input_features.v1 开始运行..
[2018-07-21 09:07:09.533583] INFO: bigquant: 命中缓存
[2018-07-21 09:07:09.534437] INFO: bigquant: input_features.v1 运行完成[0.005389s].
[2018-07-21 09:07:09.733215] INFO: bigquant: derived_feature_extractor.v3 开始运行..
[2018-07-21 09:07:10.531858] INFO: derived_feature_extractor: 提取完成 relative_ret(close_0), 0.775s
[2018-07-21 09:07:10.552099] INFO: derived_feature_extractor: /y_2017, 2434
[2018-07-21 09:07:10.574013] INFO: bigquant: derived_feature_extractor.v3 运行完成[0.8408s].
[2018-07-21 09:07:10.577004] INFO: bigquant: derived_feature_extractor.v3 开始运行..
[2018-07-21 09:07:10.602979] INFO: derived_feature_extractor: 提取完成 close_0/close_5-1, 0.002s
[2018-07-21 09:07:10.614650] INFO: derived_feature_extractor: 提取完成 sum(mf_net_amount_l_0, 5), 0.011s
[2018-07-21 09:07:10.634869] INFO: derived_feature_extractor: /y_2017, 2434
[2018-07-21 09:07:10.655059] INFO: bigquant: derived_feature_extractor.v3 运行完成[0.07805s].