中性化处理模块调用出错


(qwe9527) #1

代码如下,麻烦帮忙看看

train_start_date = '2019-10-01'
train_end_date = '2019-10-20'
other_fea = [
    'industry_sw_level1_0',
    'market_cap_float_0'
]


m1 = M.instruments.v2(
    start_date=train_start_date,
    end_date=train_end_date,
    market='CN_STOCK_A',
    instrument_list='',
    max_count=0
)

m2 = M.advanced_auto_labeler.v2(
    instruments=m1.data,
    label_expr="""
    
shift(close, -5) / shift(open, -1)

clip(label, all_quantile(label, 0.01), all_quantile(label, 0.99))

all_wbins(label, 20)

where(shift(high, -1) == shift(low, -1), NaN, label)
""",
    start_date='',
    end_date='',
    benchmark='000300.SHA',
    drop_na_label=True,
    cast_label_int=True
)

m3 = M.input_features.v1(
    features="""# #号开始的表示注释


std(turn_0, 15)

"""
)

m30 = M.input_features.v1(
    features=m3.data,
    features_ds=other_fea
)


m4 = M.general_feature_extractor.v7(
    instruments=m1.data,
    features=m30.data,
    start_date='',
    end_date='',
    before_start_days=0
)

m5 = M.derived_feature_extractor.v3(
    input_data=m4.data,
    features=m3.data,
    date_col='date',
    instrument_col='instrument'
)

m6 = M.chinaa_stock_filter.v1(
    input_data=m5.data,
    index_constituent_cond=['全部'],
    board_cond=['上证主板', '深证主板'],
    industry_cond=['全部'],
    st_cond=['正常'],
    output_left_data=False
)

m40 = M.neutralize.v13(
    input_1=m6.data,
    input_2=m30.data,
    market_value_key=True,
    industry_output_key=True,
    market_col_name='market_cap_float_0',
    industry_sw_col_name='industry_sw_level1_0',
    columns_input=''
)

报错如下


(iQuant) #2

收到问题,已提交给策略工程师,会尽快为您回复。


(达达) #3

处理一下缺失值试试


(qwe9527) #4

可以了👍