{"Description":"实验创建于2020/10/15","Summary":"","Graph":{"EdgesInternal":[{"DestinationInputPortId":"-30:features","SourceOutputPortId":"-25:data"},{"DestinationInputPortId":"-62:features","SourceOutputPortId":"-25:data"},{"DestinationInputPortId":"-62:input_data","SourceOutputPortId":"-30:data"},{"DestinationInputPortId":"-30:instruments","SourceOutputPortId":"-36:data"},{"DestinationInputPortId":"-86:input_1","SourceOutputPortId":"-62:data"}],"ModuleNodes":[{"Id":"-25","ModuleId":"BigQuantSpace.input_features.input_features-v1","ModuleParameters":[{"Name":"features","Value":"\n# #号开始的表示注释,注释需单独一行\n# 多个特征,每行一个,可以包含基础特征和衍生特征,特征须为本平台特征\nfactor=pe_ttm_0\nret=shift(return_0-1,-1)","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features_ds","NodeId":"-25"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-25","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":2,"IsPartOfPartialRun":null,"Comment":"","CommentCollapsed":true},{"Id":"-30","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":90,"ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"instruments","NodeId":"-30"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features","NodeId":"-30"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-30","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":3,"IsPartOfPartialRun":null,"Comment":"","CommentCollapsed":true},{"Id":"-36","ModuleId":"BigQuantSpace.instruments.instruments-v2","ModuleParameters":[{"Name":"start_date","Value":"2019-01-01","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"end_date","Value":"2019-03-01","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"market","Value":"CN_STOCK_A","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"instrument_list","Value":"","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"max_count","Value":0,"ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"rolling_conf","NodeId":"-36"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-36","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":4,"IsPartOfPartialRun":null,"Comment":"","CommentCollapsed":true},{"Id":"-62","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":"drop_na","Value":"False","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"remove_extra_columns","Value":"False","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"user_functions","Value":"{}","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"input_data","NodeId":"-62"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"features","NodeId":"-62"}],"OutputPortsInternal":[{"Name":"data","NodeId":"-62","OutputType":null}],"UsePreviousResults":true,"moduleIdForCode":5,"IsPartOfPartialRun":null,"Comment":"","CommentCollapsed":true},{"Id":"-86","ModuleId":"BigQuantSpace.cached.cached-v3","ModuleParameters":[{"Name":"run","Value":"# Python 代码入口函数,input_1/2/3 对应三个输入端,data_1/2/3 对应三个输出端\ndef bigquant_run(input_1,N):\n # 示例代码如下。在这里编写您的代码\n \n df = input_1.read_df().sort_values(by=['date','factor'],ascending=True)\n df['ranker'] = df.groupby('date',group_keys=False)['factor'].rank(pct=True)\n groups = [ 0.1 * k for k in range(11)]\n df['group'] = df.groupby('date',group_keys=False)['ranker'].apply(lambda x:pd.cut(x, groups,labels=[k for k in range(1,11)]))\n grouped_processed_df = df.groupby(['date','group'])['ret'].agg(np.mean).fillna(0).reset_index()\n \n ret_df = pd.pivot_table(grouped_processed_df,values='ret',index='date',columns='group').fillna(0)\n \n ret_filter = ret_df.iloc[0::N]\n \n results = (1+ret_filter).cumprod()/(1+ret_filter.iloc[0])\n \n data_2 = DataSource.write_pickle(['factor'])\n data_1 = DataSource.write_df(results)\n return Outputs(data_1=data_1,data_2=data_2)\n","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"post_run","Value":"# 后处理函数,可选。输入是主函数的输出,可以在这里对数据做处理,或者返回更友好的outputs数据格式。此函数输出不会被缓存。\ndef bigquant_run(outputs):\n results = outputs.data_1.read()\n factor = outputs.data_2.read_pickle()[0]\n T.plot(results[[1,2,3,4,5]], \n options={\n 'legend':{'enabled': True},\n 'chart': {'type': 'line'},\n 'title': {'text': factor+' :因子分组收益'}})\n return outputs\n","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"input_ports","Value":"input_1","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"params","Value":"{\"N\":1}","ValueType":"Literal","LinkedGlobalParameter":null},{"Name":"output_ports","Value":"","ValueType":"Literal","LinkedGlobalParameter":null}],"InputPortsInternal":[{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"input_1","NodeId":"-86"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"input_2","NodeId":"-86"},{"DataSourceId":null,"TrainedModelId":null,"TransformModuleId":null,"Name":"input_3","NodeId":"-86"}],"OutputPortsInternal":[{"Name":"data_1","NodeId":"-86","OutputType":null},{"Name":"data_2","NodeId":"-86","OutputType":null},{"Name":"data_3","NodeId":"-86","OutputType":null}],"UsePreviousResults":false,"moduleIdForCode":1,"IsPartOfPartialRun":null,"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='-25' Position='198,103,200,200'/><NodePosition Node='-30' Position='81,210,200,200'/><NodePosition Node='-36' Position='-99,114,200,200'/><NodePosition Node='-62' Position='144,283,200,200'/><NodePosition Node='-86' Position='231.83181762695312,389.9818115234375,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}
[2020-10-15 16:50:21.728363] INFO: moduleinvoker: input_features.v1 开始运行..
[2020-10-15 16:50:21.755391] INFO: moduleinvoker: 命中缓存
[2020-10-15 16:50:21.756945] INFO: moduleinvoker: input_features.v1 运行完成[0.028617s].
[2020-10-15 16:50:21.759980] INFO: moduleinvoker: instruments.v2 开始运行..
[2020-10-15 16:50:21.771321] INFO: moduleinvoker: 命中缓存
[2020-10-15 16:50:21.772936] INFO: moduleinvoker: instruments.v2 运行完成[0.012953s].
[2020-10-15 16:50:21.788824] INFO: moduleinvoker: general_feature_extractor.v7 开始运行..
[2020-10-15 16:50:21.796581] INFO: moduleinvoker: 命中缓存
[2020-10-15 16:50:21.797747] INFO: moduleinvoker: general_feature_extractor.v7 运行完成[0.008926s].
[2020-10-15 16:50:21.801091] INFO: moduleinvoker: derived_feature_extractor.v3 开始运行..
[2020-10-15 16:50:21.811139] INFO: moduleinvoker: 命中缓存
[2020-10-15 16:50:21.812863] INFO: moduleinvoker: derived_feature_extractor.v3 运行完成[0.01176s].
[2020-10-15 16:50:21.818023] INFO: moduleinvoker: cached.v3 开始运行..
[2020-10-15 16:50:29.072167] INFO: moduleinvoker: cached.v3 运行完成[7.254157s].