克隆策略

    {"description":"实验创建于2017/8/26","graph":{"edges":[{"to_node_id":"-158:instruments","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-8:data"},{"to_node_id":"-54:input_2","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"to_node_id":"-292:features","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"to_node_id":"-58:features_ds","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"to_node_id":"-54:input_1","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-84:data"},{"to_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-84:input_data","from_node_id":"-114:data"},{"to_node_id":"-292:input_data","from_node_id":"-54:data"},{"to_node_id":"-114:features","from_node_id":"-58:data"},{"to_node_id":"-158:features","from_node_id":"-58:data"},{"to_node_id":"-114:input_data","from_node_id":"-158:data"}],"nodes":[{"node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-8","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2015-01-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2016-01-01","type":"Literal","bound_global_parameter":null},{"name":"market","value":"CN_STOCK_A","type":"Literal","bound_global_parameter":null},{"name":"instrument_list","value":"","type":"Literal","bound_global_parameter":null},{"name":"max_count","value":"0","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"rolling_conf","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-8"}],"output_ports":[{"name":"data","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-8"}],"cacheable":true,"seq_num":1,"comment":"","comment_collapsed":true},{"node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"# #号开始的表示注释\n# 多个特征,每行一个,可以包含基础特征和衍生特征\nfs_current_assets_0\nclose_0","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24"}],"output_ports":[{"name":"data","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24"}],"cacheable":true,"seq_num":3,"comment":"","comment_collapsed":true},{"node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-84","module_id":"BigQuantSpace.dropnan.dropnan-v1","parameters":[],"input_ports":[{"name":"input_data","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-84"}],"output_ports":[{"name":"data","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-84"}],"cacheable":true,"seq_num":13,"comment":"","comment_collapsed":true},{"node_id":"-114","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":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_data","node_id":"-114"},{"name":"features","node_id":"-114"}],"output_ports":[{"name":"data","node_id":"-114"}],"cacheable":true,"seq_num":16,"comment":"","comment_collapsed":true},{"node_id":"-54","module_id":"BigQuantSpace.standardlize.standardlize-v8","parameters":[{"name":"columns_input","value":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_1","node_id":"-54"},{"name":"input_2","node_id":"-54"}],"output_ports":[{"name":"data","node_id":"-54"}],"cacheable":true,"seq_num":5,"comment":"","comment_collapsed":true},{"node_id":"-292","module_id":"BigQuantSpace.fillnan.fillnan-v1","parameters":[{"name":"fill_value","value":"0.0","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_data","node_id":"-292"},{"name":"features","node_id":"-292"}],"output_ports":[{"name":"data","node_id":"-292"}],"cacheable":true,"seq_num":6,"comment":"","comment_collapsed":true},{"node_id":"-58","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"# #号开始的表示注释\n# 多个特征,每行一个,可以包含基础特征和衍生特征\nindustry_sw_level1_0\nmarket_cap_0","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-58"}],"output_ports":[{"name":"data","node_id":"-58"}],"cacheable":true,"seq_num":8,"comment":"","comment_collapsed":true},{"node_id":"-158","module_id":"BigQuantSpace.general_feature_extractor.general_feature_extractor-v7","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":90,"type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"-158"},{"name":"features","node_id":"-158"}],"output_ports":[{"name":"data","node_id":"-158"}],"cacheable":true,"seq_num":4,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-8' Position='202,94,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-24' Position='709,-16,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-84' Position='374,349,200,200'/><node_position Node='-114' Position='378,270,200,200'/><node_position Node='-54' Position='363.6203308105469,482.7433776855469,200,200'/><node_position Node='-292' Position='397,581,200,200'/><node_position Node='-58' Position='505,83,200,200'/><node_position Node='-158' Position='383,186,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
    In [2]:
    # 本代码由可视化策略环境自动生成 2021年11月25日 19:52
    # 本代码单元只能在可视化模式下编辑。您也可以拷贝代码,粘贴到新建的代码单元或者策略,然后修改。
    
    
    m1 = M.instruments.v2(
        start_date='2015-01-01',
        end_date='2016-01-01',
        market='CN_STOCK_A',
        instrument_list='',
        max_count=0
    )
    
    m3 = M.input_features.v1(
        features="""# #号开始的表示注释
    # 多个特征,每行一个,可以包含基础特征和衍生特征
    fs_current_assets_0
    close_0"""
    )
    
    m8 = M.input_features.v1(
        features_ds=m3.data,
        features="""# #号开始的表示注释
    # 多个特征,每行一个,可以包含基础特征和衍生特征
    industry_sw_level1_0
    market_cap_0"""
    )
    
    m4 = M.general_feature_extractor.v7(
        instruments=m1.data,
        features=m8.data,
        start_date='',
        end_date='',
        before_start_days=90
    )
    
    m16 = M.derived_feature_extractor.v3(
        input_data=m4.data,
        features=m8.data,
        date_col='date',
        instrument_col='instrument',
        drop_na=False,
        remove_extra_columns=False
    )
    
    m13 = M.dropnan.v1(
        input_data=m16.data
    )
    
    m5 = M.standardlize.v8(
        input_1=m13.data,
        input_2=m3.data,
        columns_input=''
    )
    
    m6 = M.fillnan.v1(
        input_data=m5.data,
        features=m3.data,
        fill_value='0.0'
    )
    
    In [3]:
    m6.data.read_df().head()
    
    Out[3]:
    close_0 date fs_current_assets_0 industry_sw_level1_0 instrument market_cap_0
    61 0.552780 2014-10-08 14.237005 430000 000002.SZA 1.039819e+11
    62 0.560158 2014-10-09 14.241745 430000 000002.SZA 1.043123e+11
    63 0.565175 2014-10-10 15.016461 430000 000002.SZA 1.054138e+11
    64 0.571188 2014-10-13 14.174874 430000 000002.SZA 1.061849e+11
    65 0.572361 2014-10-14 14.187576 430000 000002.SZA 1.047529e+11
    In [ ]: