{"description":"实验创建于2017/8/26","graph":{"edges":[{"to_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-29:instruments","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-8:data"},{"to_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-15:instruments","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-8:data"},{"to_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-53:data1","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-15:data"},{"to_node_id":"-13313:features_ds","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"to_node_id":"-14127:input_2","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"to_node_id":"-14414:input_2","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"to_node_id":"-3841:features","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"to_node_id":"-3846:features","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"to_node_id":"-1545:input_2","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"to_node_id":"-1563:input_2","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24:data"},{"to_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-35:input_data","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-29:data"},{"to_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-53:data2","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-35:data"},{"to_node_id":"-17504:input_data","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-53:data"},{"to_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-70:instruments","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-62:data"},{"to_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-81:instruments","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-62:data"},{"to_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-76:input_data","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-70:data"},{"to_node_id":"-17510:input_data","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-76:data"},{"to_node_id":"-14127:input_1","from_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-84:data"},{"to_node_id":"-14414:input_1","from_node_id":"-86:data"},{"to_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-29:features","from_node_id":"-13313:data"},{"to_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-35:features","from_node_id":"-13313:data"},{"to_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-70:features","from_node_id":"-13313:data"},{"to_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-76:features","from_node_id":"-13313:data"},{"to_node_id":"-6806:input_1","from_node_id":"-17504:data"},{"to_node_id":"-8718:input_1","from_node_id":"-17510:data"},{"to_node_id":"-6810:input_1","from_node_id":"-6806:data_1"},{"to_node_id":"-7994:input_1","from_node_id":"-6810:data_1"},{"to_node_id":"-8704:input_1","from_node_id":"-7994:data_1"},{"to_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-84:input_data","from_node_id":"-8704:data_1"},{"to_node_id":"-86:input_data","from_node_id":"-8714:data_1"},{"to_node_id":"-8721:input_1","from_node_id":"-8718:data_1"},{"to_node_id":"-8724:input_1","from_node_id":"-8721:data_1"},{"to_node_id":"-8714:input_1","from_node_id":"-8724:data_1"},{"to_node_id":"-3841:input_data","from_node_id":"-14127:data"},{"to_node_id":"-3846:input_data","from_node_id":"-14414:data"},{"to_node_id":"-1545:input_1","from_node_id":"-3841:data"},{"to_node_id":"-1563:input_3","from_node_id":"-3846:data"},{"to_node_id":"-1563:input_1","from_node_id":"-1545:data_1"},{"to_node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-81:options_data","from_node_id":"-1563:data_1"}],"nodes":[{"node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-8","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2005-01-01","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"2017-12-31","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-15","module_id":"BigQuantSpace.advanced_auto_labeler.advanced_auto_labeler-v2","parameters":[{"name":"label_expr","value":"# #号开始的表示注释\n# 0. 每行一个,顺序执行,从第二个开始,可以使用label字段\n# 1. 可用数据字段见 {{web_host_url}}docs/data_history_data.html\n# 添加benchmark_前缀,可使用对应的benchmark数据\n# 2. 可用操作符和函数见 `表达式引擎 <{{web_host_url}}docs/big_expr.html>`_\n\n# 计算收益:5日收盘价(作为卖出价格)除以明日开盘价(作为买入价格)\n#rank(where(shift(close, -5) / shift(open, -1)>1, rank(shift(close, -5) / shift(open, -1)), 0))\nwhere(shift(close, -20) / shift(open, -1)>=1, 1, -1)\n\n\n# 极值处理:用1%和99%分位的值做clip\n#clip(label, all_quantile(label, 0.01), all_quantile(label, 0.99))\n\n# 将分数映射到分类,这里使用20个分类\nall_wbins(label, 2)\n\n# 过滤掉一字涨停的情况 (设置label为NaN,在后续处理和训练中会忽略NaN的label)\nwhere(shift(high, -1) == shift(low, -1), NaN, label)\n","type":"Literal","bound_global_parameter":null},{"name":"start_date","value":"","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"","type":"Literal","bound_global_parameter":null},{"name":"benchmark","value":"000300.HIX","type":"Literal","bound_global_parameter":null},{"name":"drop_na_label","value":"True","type":"Literal","bound_global_parameter":null},{"name":"cast_label_int","value":"True","type":"Literal","bound_global_parameter":null},{"name":"user_functions","value":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-15"}],"output_ports":[{"name":"data","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-15"}],"cacheable":true,"seq_num":2,"comment":"","comment_collapsed":true},{"node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-24","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"open_0\nclose_0\nhigh_0\nlow_0\nturn_0\nreturn_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-29","module_id":"BigQuantSpace.general_feature_extractor.general_feature_extractor-v6","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":"50","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-29"},{"name":"features","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-29"}],"output_ports":[{"name":"data","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-29"}],"cacheable":true,"seq_num":4,"comment":"","comment_collapsed":true},{"node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-35","module_id":"BigQuantSpace.derived_feature_extractor.derived_feature_extractor-v2","parameters":[{"name":"date_col","value":"date","type":"Literal","bound_global_parameter":null},{"name":"instrument_col","value":"instrument","type":"Literal","bound_global_parameter":null},{"name":"user_functions","value":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_data","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-35"},{"name":"features","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-35"}],"output_ports":[{"name":"data","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-35"}],"cacheable":true,"seq_num":5,"comment":"","comment_collapsed":true},{"node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-53","module_id":"BigQuantSpace.join.join-v3","parameters":[{"name":"on","value":"date,instrument","type":"Literal","bound_global_parameter":null},{"name":"how","value":"inner","type":"Literal","bound_global_parameter":null},{"name":"sort","value":"False","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"data1","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-53"},{"name":"data2","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-53"}],"output_ports":[{"name":"data","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-53"}],"cacheable":true,"seq_num":7,"comment":"","comment_collapsed":true},{"node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-62","module_id":"BigQuantSpace.instruments.instruments-v2","parameters":[{"name":"start_date","value":"2018-01-01","type":"Literal","bound_global_parameter":"交易日期"},{"name":"end_date","value":"2022-03-24","type":"Literal","bound_global_parameter":"交易日期"},{"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-62"}],"output_ports":[{"name":"data","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-62"}],"cacheable":true,"seq_num":9,"comment":"预测数据,用于回测和模拟","comment_collapsed":false},{"node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-70","module_id":"BigQuantSpace.general_feature_extractor.general_feature_extractor-v6","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":"0","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-70"},{"name":"features","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-70"}],"output_ports":[{"name":"data","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-70"}],"cacheable":true,"seq_num":10,"comment":"","comment_collapsed":true},{"node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-76","module_id":"BigQuantSpace.derived_feature_extractor.derived_feature_extractor-v2","parameters":[{"name":"date_col","value":"date","type":"Literal","bound_global_parameter":null},{"name":"instrument_col","value":"instrument","type":"Literal","bound_global_parameter":null},{"name":"user_functions","value":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_data","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-76"},{"name":"features","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-76"}],"output_ports":[{"name":"data","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-76"}],"cacheable":true,"seq_num":11,"comment":"","comment_collapsed":true},{"node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-81","module_id":"BigQuantSpace.trade.trade-v3","parameters":[{"name":"start_date","value":"","type":"Literal","bound_global_parameter":null},{"name":"end_date","value":"","type":"Literal","bound_global_parameter":null},{"name":"handle_data","value":"#import random\n# 回测引擎:每日数据处理函数,每天执行一次\ndef bigquant_run(context, data):\n # 按日期过滤得到今日的预测数据\n ranker_prediction = context.ranker_prediction[\n context.ranker_prediction.date == data.current_dt.strftime('%Y-%m-%d')]\n\n # 1. 资金分配\n # 平均持仓时间是hold_days,每日都将买入股票,每日预期使用 1/hold_days 的资金\n # 实际操作中,会存在一定的买入误差,所以在前hold_days天,等量使用资金;之后,尽量使用剩余资金(这里设置最多用等量的1.5倍)\n is_staging = context.trading_day_index < context.options['hold_days'] # 是否在建仓期间(前 hold_days 天)\n cash_avg = context.portfolio.portfolio_value / context.options['hold_days']\n cash_for_buy = min(context.portfolio.cash, (1 if is_staging else 1.5) * cash_avg)\n cash_for_sell = cash_avg - (context.portfolio.cash - cash_for_buy)\n positions = {e.symbol: p.amount * p.last_sale_price\n for e, p in context.perf_tracker.position_tracker.positions.items()}\n\n # 2. 生成卖出订单:hold_days天之后才开始卖出;对持仓的股票,按机器学习算法预测的排序末位淘汰\n if not is_staging and cash_for_sell > 0:\n equities = {e.symbol: e for e, p in context.perf_tracker.position_tracker.positions.items()}\n instruments = list(reversed(list(ranker_prediction.instrument[ranker_prediction.instrument.apply(\n lambda x: x in equities and not context.has_unfinished_sell_order(equities[x]))])))\n # print('rank order for sell %s' % instruments)\n for instrument in instruments:\n context.order_target(context.symbol(instrument), 0)\n cash_for_sell -= positions[instrument]\n if cash_for_sell <= 0:\n break\n\n # 3. 生成买入订单:按机器学习算法预测的排序,买入前面的stock_count只股票\n buy_cash_weights = context.stock_weights\n #random.shuffle(buy_cash_weights)\n #buy_cash_weights=buy_cash_weights[:3]\n buy_instruments = list(ranker_prediction.instrument[:len(buy_cash_weights)])\n \n max_cash_per_instrument = context.portfolio.portfolio_value * context.max_cash_per_instrument\n for i, instrument in enumerate(buy_instruments):\n cash = cash_for_buy * buy_cash_weights[i]\n if cash > max_cash_per_instrument - positions.get(instrument, 0):\n # 确保股票持仓量不会超过每次股票最大的占用资金量\n cash = max_cash_per_instrument - positions.get(instrument, 0)\n if cash > 0:\n context.order_value(context.symbol(instrument), cash)\n","type":"Literal","bound_global_parameter":null},{"name":"prepare","value":"# 回测引擎:准备数据,只执行一次\ndef bigquant_run(context):\n pass\n","type":"Literal","bound_global_parameter":null},{"name":"initialize","value":"# 回测引擎:初始化函数,只执行一次\ndef bigquant_run(context):\n # 加载预测数据\n context.ranker_prediction = context.options['data'].read_df()\n\n # 系统已经设置了默认的交易手续费和滑点,要修改手续费可使用如下函数\n context.set_commission(PerOrder(buy_cost=0.0003, sell_cost=0.0013, min_cost=5))\n # 预测数据,通过options传入进来,使用 read_df 函数,加载到内存 (DataFrame)\n # 设置买入的股票数量,这里买入预测股票列表排名靠前的5只\n stock_count = 3\n # 每只的股票的权重,如下的权重分配会使得靠前的股票分配多一点的资金,[0.339160, 0.213986, 0.169580, ..]\n context.stock_weights = T.norm([1 / math.log(i + 2) for i in range(0, stock_count)])\n # 设置每只股票占用的最大资金比例\n context.max_cash_per_instrument = 0.33\n context.options['hold_days'] = 20\n","type":"Literal","bound_global_parameter":null},{"name":"before_trading_start","value":"","type":"Literal","bound_global_parameter":null},{"name":"volume_limit","value":"0","type":"Literal","bound_global_parameter":null},{"name":"order_price_field_buy","value":"open","type":"Literal","bound_global_parameter":null},{"name":"order_price_field_sell","value":"close","type":"Literal","bound_global_parameter":null},{"name":"capital_base","value":"150000","type":"Literal","bound_global_parameter":null},{"name":"benchmark","value":"000300.HIX","type":"Literal","bound_global_parameter":null},{"name":"auto_cancel_non_tradable_orders","value":"True","type":"Literal","bound_global_parameter":null},{"name":"data_frequency","value":"daily","type":"Literal","bound_global_parameter":null},{"name":"price_type","value":"真实价格","type":"Literal","bound_global_parameter":null},{"name":"plot_charts","value":"True","type":"Literal","bound_global_parameter":null},{"name":"backtest_only","value":"False","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"instruments","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-81"},{"name":"options_data","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-81"}],"output_ports":[{"name":"raw_perf","node_id":"287d2cb0-f53c-4101-bdf8-104b137c8601-81"}],"cacheable":false,"seq_num":12,"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":"-86","module_id":"BigQuantSpace.dropnan.dropnan-v1","parameters":[],"input_ports":[{"name":"input_data","node_id":"-86"}],"output_ports":[{"name":"data","node_id":"-86"}],"cacheable":true,"seq_num":14,"comment":"","comment_collapsed":true},{"node_id":"-13313","module_id":"BigQuantSpace.input_features.input_features-v1","parameters":[{"name":"features","value":"# #号开始的表示注释\n# 多个特征,每行一个,可以包含基础特征和衍生特征\n#ST状态:0:正常股票,1:ST,2:*ST,11:暂停上市\nst_status_0\n#上市板,主板:1,中小企业板:2,创业板:3\nlist_board_0\n#已上市的天数\nlist_days_0","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"features_ds","node_id":"-13313"}],"output_ports":[{"name":"data","node_id":"-13313"}],"cacheable":true,"seq_num":15,"comment":"","comment_collapsed":true},{"node_id":"-17504","module_id":"BigQuantSpace.filter.filter-v3","parameters":[{"name":"expr","value":"list_board_0==1 and list_days_0>=365","type":"Literal","bound_global_parameter":null},{"name":"output_left_data","value":"False","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_data","node_id":"-17504"}],"output_ports":[{"name":"data","node_id":"-17504"},{"name":"left_data","node_id":"-17504"}],"cacheable":true,"seq_num":16,"comment":"","comment_collapsed":true},{"node_id":"-17510","module_id":"BigQuantSpace.filter.filter-v3","parameters":[{"name":"expr","value":"list_board_0==1 and list_days_0>=365 ","type":"Literal","bound_global_parameter":null},{"name":"output_left_data","value":"False","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_data","node_id":"-17510"}],"output_ports":[{"name":"data","node_id":"-17510"},{"name":"left_data","node_id":"-17510"}],"cacheable":true,"seq_num":17,"comment":"","comment_collapsed":true},{"node_id":"-6806","module_id":"BigQuantSpace.filter_delist_stock.filter_delist_stock-v6","parameters":[],"input_ports":[{"name":"input_1","node_id":"-6806"}],"output_ports":[{"name":"data_1","node_id":"-6806"}],"cacheable":true,"seq_num":18,"comment":"","comment_collapsed":true},{"node_id":"-6810","module_id":"BigQuantSpace.filtet_st_stock_tomo.filtet_st_stock_tomo-v3","parameters":[],"input_ports":[{"name":"input_1","node_id":"-6810"}],"output_ports":[{"name":"data_1","node_id":"-6810"}],"cacheable":true,"seq_num":20,"comment":"","comment_collapsed":true},{"node_id":"-7994","module_id":"BigQuantSpace.filtet_st_stock.filtet_st_stock-v7","parameters":[],"input_ports":[{"name":"input_1","node_id":"-7994"}],"output_ports":[{"name":"data_1","node_id":"-7994"}],"cacheable":true,"seq_num":19,"comment":"","comment_collapsed":true},{"node_id":"-8704","module_id":"BigQuantSpace.filter_stockmarket.filter_stockmarket-v2","parameters":[{"name":"start","value":"3","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_1","node_id":"-8704"}],"output_ports":[{"name":"data_1","node_id":"-8704"}],"cacheable":true,"seq_num":21,"comment":"","comment_collapsed":true},{"node_id":"-8714","module_id":"BigQuantSpace.filter_stockmarket.filter_stockmarket-v2","parameters":[{"name":"start","value":"3","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_1","node_id":"-8714"}],"output_ports":[{"name":"data_1","node_id":"-8714"}],"cacheable":true,"seq_num":23,"comment":"","comment_collapsed":true},{"node_id":"-8718","module_id":"BigQuantSpace.filter_delist_stock.filter_delist_stock-v6","parameters":[],"input_ports":[{"name":"input_1","node_id":"-8718"}],"output_ports":[{"name":"data_1","node_id":"-8718"}],"cacheable":true,"seq_num":24,"comment":"","comment_collapsed":true},{"node_id":"-8721","module_id":"BigQuantSpace.filtet_st_stock_tomo.filtet_st_stock_tomo-v3","parameters":[],"input_ports":[{"name":"input_1","node_id":"-8721"}],"output_ports":[{"name":"data_1","node_id":"-8721"}],"cacheable":true,"seq_num":25,"comment":"","comment_collapsed":true},{"node_id":"-8724","module_id":"BigQuantSpace.filtet_st_stock.filtet_st_stock-v7","parameters":[],"input_ports":[{"name":"input_1","node_id":"-8724"}],"output_ports":[{"name":"data_1","node_id":"-8724"}],"cacheable":true,"seq_num":26,"comment":"","comment_collapsed":true},{"node_id":"-14127","module_id":"BigQuantSpace.standardlize.standardlize-v9","parameters":[{"name":"standard_func","value":"RobustZScoreNorm","type":"Literal","bound_global_parameter":null},{"name":"columns_input","value":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_1","node_id":"-14127"},{"name":"input_2","node_id":"-14127"}],"output_ports":[{"name":"data","node_id":"-14127"}],"cacheable":true,"seq_num":22,"comment":"","comment_collapsed":true},{"node_id":"-14414","module_id":"BigQuantSpace.standardlize.standardlize-v9","parameters":[{"name":"standard_func","value":"RobustZScoreNorm","type":"Literal","bound_global_parameter":null},{"name":"columns_input","value":"","type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_1","node_id":"-14414"},{"name":"input_2","node_id":"-14414"}],"output_ports":[{"name":"data","node_id":"-14414"}],"cacheable":true,"seq_num":27,"comment":"","comment_collapsed":true},{"node_id":"-3841","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":"-3841"},{"name":"features","node_id":"-3841"}],"output_ports":[{"name":"data","node_id":"-3841"}],"cacheable":true,"seq_num":28,"comment":"","comment_collapsed":true},{"node_id":"-3846","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":"-3846"},{"name":"features","node_id":"-3846"}],"output_ports":[{"name":"data","node_id":"-3846"}],"cacheable":true,"seq_num":29,"comment":"","comment_collapsed":true},{"node_id":"-1545","module_id":"BigQuantSpace.gplearn_train.gplearn_train-v3","parameters":[{"name":"IS_USE_BEST_GP","value":"True","type":"Literal","bound_global_parameter":null},{"name":"gnrtn","value":3,"type":"Literal","bound_global_parameter":null},{"name":"ppltn","value":80,"type":"Literal","bound_global_parameter":null},{"name":"max_samples","value":0.9,"type":"Literal","bound_global_parameter":null},{"name":"metric","value":"mse","type":"Literal","bound_global_parameter":null},{"name":"stopping_criteria","value":0.01,"type":"Literal","bound_global_parameter":null},{"name":"init_depth_min","value":"2","type":"Literal","bound_global_parameter":null},{"name":"init_depth_max","value":"6","type":"Literal","bound_global_parameter":null},{"name":"p_crossover","value":0.9,"type":"Literal","bound_global_parameter":null},{"name":"p_hoist_mutation","value":0.01,"type":"Literal","bound_global_parameter":null},{"name":"p_point_mutation","value":0.05,"type":"Literal","bound_global_parameter":null},{"name":"p_point_replace","value":0.01,"type":"Literal","bound_global_parameter":null},{"name":"p_subtree_mutation","value":0.01,"type":"Literal","bound_global_parameter":null}],"input_ports":[{"name":"input_1","node_id":"-1545"},{"name":"input_2","node_id":"-1545"}],"output_ports":[{"name":"data_1","node_id":"-1545"},{"name":"data_2","node_id":"-1545"}],"cacheable":true,"seq_num":30,"comment":"","comment_collapsed":true},{"node_id":"-1563","module_id":"BigQuantSpace.GP_predict.GP_predict-v2","parameters":[],"input_ports":[{"name":"input_1","node_id":"-1563"},{"name":"input_2","node_id":"-1563"},{"name":"input_3","node_id":"-1563"}],"output_ports":[{"name":"data_1","node_id":"-1563"}],"cacheable":true,"seq_num":31,"comment":"","comment_collapsed":true}],"node_layout":"<node_postions><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-8' Position='240,-167,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-15' Position='70,183,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-24' Position='589,-89,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-29' Position='381,188,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-35' Position='385,280,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-53' Position='254,374,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-62' Position='947,-162,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-70' Position='977,170,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-76' Position='976,263,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-81' Position='986,1227,200,200'/><node_position Node='287d2cb0-f53c-4101-bdf8-104b137c8601-84' Position='267,902,200,200'/><node_position Node='-86' Position='853,788,200,200'/><node_position Node='-13313' Position='510,75,200,200'/><node_position Node='-17504' Position='251,470,200,200'/><node_position Node='-17510' Position='973,359,200,200'/><node_position Node='-6806' Position='243,552,200,200'/><node_position Node='-6810' Position='249,625,200,200'/><node_position Node='-7994' Position='260,722,200,200'/><node_position Node='-8704' Position='261,807,200,200'/><node_position Node='-8714' Position='880,699,200,200'/><node_position Node='-8718' Position='937,437,200,200'/><node_position Node='-8721' Position='918,510,200,200'/><node_position Node='-8724' Position='904,602,200,200'/><node_position Node='-14127' Position='618,622,200,200'/><node_position Node='-14414' Position='1030,886,200,200'/><node_position Node='-3841' Position='583,824,200,200'/><node_position Node='-3846' Position='970,995,200,200'/><node_position Node='-1545' Position='229,1087,200,200'/><node_position Node='-1563' Position='528,1220,200,200'/></node_postions>"},"nodes_readonly":false,"studio_version":"v2"}
[2022-03-25 21:34:29.329943] INFO: moduleinvoker: instruments.v2 开始运行..
[2022-03-25 21:34:29.350817] INFO: moduleinvoker: 命中缓存
[2022-03-25 21:34:29.352563] INFO: moduleinvoker: instruments.v2 运行完成[0.022641s].
[2022-03-25 21:34:29.439088] INFO: moduleinvoker: advanced_auto_labeler.v2 开始运行..
[2022-03-25 21:34:29.451241] INFO: moduleinvoker: 命中缓存
[2022-03-25 21:34:29.455226] INFO: moduleinvoker: advanced_auto_labeler.v2 运行完成[0.016134s].
[2022-03-25 21:34:29.505378] INFO: moduleinvoker: input_features.v1 开始运行..
[2022-03-25 21:34:29.563233] INFO: moduleinvoker: input_features.v1 运行完成[0.057861s].
[2022-03-25 21:34:29.572831] INFO: moduleinvoker: input_features.v1 开始运行..
[2022-03-25 21:34:29.647272] INFO: moduleinvoker: input_features.v1 运行完成[0.074475s].
[2022-03-25 21:34:29.669968] INFO: moduleinvoker: general_feature_extractor.v6 开始运行..
[2022-03-25 21:34:29.993547] INFO: 基础特征抽取: 年份 2004, 特征行数=0
[2022-03-25 21:34:44.345391] INFO: 基础特征抽取: 年份 2005, 特征行数=314144
[2022-03-25 21:34:46.541478] INFO: 基础特征抽取: 年份 2006, 特征行数=287870
[2022-03-25 21:34:49.606205] INFO: 基础特征抽取: 年份 2007, 特征行数=323371
[2022-03-25 21:34:52.285143] INFO: 基础特征抽取: 年份 2008, 特征行数=360328
[2022-03-25 21:35:20.241646] INFO: 基础特征抽取: 年份 2009, 特征行数=375308
[2022-03-25 21:35:27.670625] INFO: 基础特征抽取: 年份 2010, 特征行数=431567
[2022-03-25 21:36:51.328681] INFO: 基础特征抽取: 年份 2011, 特征行数=511455
[2022-03-25 21:36:57.681171] INFO: 基础特征抽取: 年份 2012, 特征行数=565675
[2022-03-25 21:37:02.234134] INFO: 基础特征抽取: 年份 2013, 特征行数=564168
[2022-03-25 21:37:06.773632] INFO: 基础特征抽取: 年份 2014, 特征行数=569948
[2022-03-25 21:37:11.202534] INFO: 基础特征抽取: 年份 2015, 特征行数=569698
[2022-03-25 21:37:16.025521] INFO: 基础特征抽取: 年份 2016, 特征行数=641546
[2022-03-25 21:37:21.819398] INFO: 基础特征抽取: 年份 2017, 特征行数=743233
[2022-03-25 21:37:22.080086] INFO: 基础特征抽取: 总行数: 6258311
[2022-03-25 21:37:22.095108] INFO: moduleinvoker: general_feature_extractor.v6 运行完成[172.425139s].
[2022-03-25 21:37:22.123329] INFO: moduleinvoker: derived_feature_extractor.v2 开始运行..
[2022-03-25 21:37:36.266336] INFO: derived_feature_extractor: /y_2005, 314144
[2022-03-25 21:37:36.950021] INFO: derived_feature_extractor: /y_2006, 287870
[2022-03-25 21:37:37.788357] INFO: derived_feature_extractor: /y_2007, 323371
[2022-03-25 21:37:38.615871] INFO: derived_feature_extractor: /y_2008, 360328
[2022-03-25 21:37:39.388576] INFO: derived_feature_extractor: /y_2009, 375308
[2022-03-25 21:37:40.470001] INFO: derived_feature_extractor: /y_2010, 431567
[2022-03-25 21:37:41.743946] INFO: derived_feature_extractor: /y_2011, 511455
[2022-03-25 21:37:43.005023] INFO: derived_feature_extractor: /y_2012, 565675
[2022-03-25 21:37:44.426191] INFO: derived_feature_extractor: /y_2013, 564168
[2022-03-25 21:37:45.861538] INFO: derived_feature_extractor: /y_2014, 569948
[2022-03-25 21:37:47.135564] INFO: derived_feature_extractor: /y_2015, 569698
[2022-03-25 21:37:48.837313] INFO: derived_feature_extractor: /y_2016, 641546
[2022-03-25 21:37:50.355647] INFO: derived_feature_extractor: /y_2017, 743233
[2022-03-25 21:37:50.827533] INFO: moduleinvoker: derived_feature_extractor.v2 运行完成[28.704196s].
[2022-03-25 21:37:50.841708] INFO: moduleinvoker: join.v3 开始运行..
[2022-03-25 21:38:04.134992] INFO: join: /y_2005, 行数=313138/314144, 耗时=2.794607s
[2022-03-25 21:38:07.116262] INFO: join: /y_2006, 行数=286781/287870, 耗时=2.977438s
[2022-03-25 21:38:10.237886] INFO: join: /y_2007, 行数=320511/323371, 耗时=3.11846s
[2022-03-25 21:38:13.561743] INFO: join: /y_2008, 行数=358830/360328, 耗时=3.32051s
[2022-03-25 21:38:16.655592] INFO: join: /y_2009, 行数=374495/375308, 耗时=3.090479s
[2022-03-25 21:38:20.033040] INFO: join: /y_2010, 行数=431045/431567, 耗时=3.373738s
[2022-03-25 21:38:23.564370] INFO: join: /y_2011, 行数=510937/511455, 耗时=3.524471s
[2022-03-25 21:38:27.204716] INFO: join: /y_2012, 行数=564597/565675, 耗时=3.634664s
[2022-03-25 21:38:30.781573] INFO: join: /y_2013, 行数=563157/564168, 耗时=3.571521s
[2022-03-25 21:38:34.796497] INFO: join: /y_2014, 行数=567889/569948, 耗时=4.007076s
[2022-03-25 21:38:38.620611] INFO: join: /y_2015, 行数=560453/569698, 耗时=3.817226s
[2022-03-25 21:38:42.594019] INFO: join: /y_2016, 行数=637492/641546, 耗时=3.966364s
[2022-03-25 21:38:47.214895] INFO: join: /y_2017, 行数=738390/743233, 耗时=4.613767s
[2022-03-25 21:38:47.369656] INFO: join: 最终行数: 6227715
[2022-03-25 21:38:47.406972] INFO: moduleinvoker: join.v3 运行完成[56.565255s].
[2022-03-25 21:38:47.418873] INFO: moduleinvoker: filter.v3 开始运行..
[2022-03-25 21:38:47.437322] INFO: filter: 使用表达式 list_board_0==1 and list_days_0>=365 过滤
[2022-03-25 21:38:47.934827] INFO: filter: 过滤 /y_2005, 298015/0/313138
[2022-03-25 21:38:48.339371] INFO: filter: 过滤 /y_2006, 271216/0/286781
[2022-03-25 21:38:48.701013] INFO: filter: 过滤 /y_2007, 280507/0/320511
[2022-03-25 21:38:49.035546] INFO: filter: 过滤 /y_2008, 295521/0/358830
[2022-03-25 21:38:49.393087] INFO: filter: 过滤 /y_2009, 304293/0/374495
[2022-03-25 21:38:49.759092] INFO: filter: 过滤 /y_2010, 301195/0/431045
[2022-03-25 21:38:50.188640] INFO: filter: 过滤 /y_2011, 306294/0/510937
[2022-03-25 21:38:50.636097] INFO: filter: 过滤 /y_2012, 316366/0/564597
[2022-03-25 21:38:51.076752] INFO: filter: 过滤 /y_2013, 319032/0/563157
[2022-03-25 21:38:51.533027] INFO: filter: 过滤 /y_2014, 319017/0/567889
[2022-03-25 21:38:51.962655] INFO: filter: 过滤 /y_2015, 299946/0/560453
[2022-03-25 21:38:52.521063] INFO: filter: 过滤 /y_2016, 336462/0/637492
[2022-03-25 21:38:53.203954] INFO: filter: 过滤 /y_2017, 355961/0/738390
[2022-03-25 21:38:53.235947] INFO: moduleinvoker: filter.v3 运行完成[5.817057s].
[2022-03-25 21:38:53.361127] INFO: moduleinvoker: filter_delist_stock.v6 开始运行..
[2022-03-25 21:39:08.349855] INFO: moduleinvoker: filter_delist_stock.v6 运行完成[14.988726s].
[2022-03-25 21:39:08.406002] INFO: moduleinvoker: filtet_st_stock_tomo.v3 开始运行..
[2022-03-25 21:39:22.891566] INFO: moduleinvoker: filtet_st_stock_tomo.v3 运行完成[14.485555s].
[2022-03-25 21:39:22.936852] INFO: moduleinvoker: filtet_st_stock.v7 开始运行..
[2022-03-25 21:39:39.734107] INFO: moduleinvoker: filtet_st_stock.v7 运行完成[16.797261s].
[2022-03-25 21:39:39.795020] INFO: moduleinvoker: filter_stockmarket.v2 开始运行..
[2022-03-25 21:39:43.724163] INFO: moduleinvoker: filter_stockmarket.v2 运行完成[3.929181s].
[2022-03-25 21:39:43.739443] INFO: moduleinvoker: dropnan.v1 开始运行..
[2022-03-25 21:39:47.924079] INFO: dropnan: /data, 3587437/3588467
[2022-03-25 21:39:48.018597] INFO: dropnan: 行数: 3587437/3588467
[2022-03-25 21:39:48.049430] INFO: moduleinvoker: dropnan.v1 运行完成[4.309987s].
[2022-03-25 21:39:48.064013] INFO: moduleinvoker: standardlize.v9 开始运行..
[2022-03-25 21:41:01.331813] INFO: moduleinvoker: standardlize.v9 运行完成[73.26779s].
[2022-03-25 21:41:01.350337] INFO: moduleinvoker: fillnan.v1 开始运行..
[2022-03-25 21:41:04.847542] INFO: moduleinvoker: fillnan.v1 运行完成[3.497203s].
[2022-03-25 21:41:04.936473] INFO: moduleinvoker: gplearn_train.v3 开始运行..
[2022-03-25 21:43:07.184901] ERROR: moduleinvoker: module name: gplearn_train, module version: v3, trackeback: AttributeError: 'DataFrame' object has no attribute 'price'
参与训练模型的因子有: ['open_0', 'close_0', 'high_0', 'low_0', 'turn_0', 'return_0']
| Population Average | Best Individual |
---- ------------------------- ------------------------------------------ ----------
Gen Length Fitness Length Fitness OOB Fitness Time Left
0 14.49 5.69083e+22 2 0.518789 0.516984 1.66m
1 4.04 6.01263e+14 3 0.326106 0.326368 30.92s
2 6.54 5.98697e+14 4 0.299645 0.299022 0.00s
############################################# 末代最佳表达式: abs(add(0.203, -0.963)) 筛选后最佳表达式: sqrt(sqrt(min(min(add(0.203, -0.963), log(X2)), abs(X3))))
############################################# 因子有效性: True
############################################# 使用全局最优表达式 True
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-1-74e9b346f46e> in <module>
189 )
190
--> 191 m30 = M.gplearn_train.v3(
192 input_1=m28.data,
193 input_2=m3.data,
AttributeError: 'DataFrame' object has no attribute 'price'