中性化处理

# 中性化处理

定义

M.neutralize.v13(input_1, input_2, 
market_value_key, industry_output_key, market_col_name, industry_sw_col_name, 
columns_input='')

参数:

  • market_value_key:是否需要进行市值中性化
  • industry_output_key:是否需要进行行业中性化
  • market_col_name:中性化处理依赖的市值列名
  • industry_sw_col_name:中性化处理依赖的行业列名
  • columns_input:输入指定需要中性化的列名

返回:

  • data, 中性化后的数据

返回类型:Outputs

工作流截图:

示例代码:

 m1 = M.neutralize.v13(
    input_data=m14.data,
    features=m3.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=''
)

运行结果:

[2019-07-20 13:43:54.147476] INFO: bigquant: input_features.v1 开始运行..
[2019-07-20 13:43:54.286376] INFO: bigquant: 命中缓存
[2019-07-20 13:43:54.292011] INFO: bigquant: input_features.v1 运行完成[0.144511s].
[2019-07-20 13:43:54.300348] INFO: bigquant: instruments.v2 开始运行..
[2019-07-20 13:43:54.456057] INFO: bigquant: instruments.v2 运行完成[0.155699s].
[2019-07-20 13:43:54.525124] INFO: bigquant: general_feature_extractor.v7 开始运行..
[2019-07-20 13:44:02.837979] INFO: 基础特征抽取: 年份 2018, 特征行数=567450
[2019-07-20 13:44:05.515114] INFO: 基础特征抽取: 年份 2019, 特征行数=353689
[2019-07-20 13:44:05.709637] INFO: 基础特征抽取: 总行数: 921139
[2019-07-20 13:44:05.718649] INFO: bigquant: general_feature_extractor.v7 运行完成[11.193526s].
[2019-07-20 13:44:05.724788] INFO: bigquant: derived_feature_extractor.v3 开始运行..
[2019-07-20 13:44:06.604160] INFO: derived_feature_extractor: 提取完成 avg_amount_0/avg_amount_5, 0.012s
[2019-07-20 13:44:06.621524] INFO: derived_feature_extractor: 提取完成 avg_amount_5/avg_amount_20, 0.010s
[2019-07-20 13:44:06.628664] INFO: derived_feature_extractor: 提取完成 rank_avg_amount_0/rank_avg_amount_5, 0.005s
[2019-07-20 13:44:06.635727] INFO: derived_feature_extractor: 提取完成 rank_avg_amount_5/rank_avg_amount_10, 0.005s
[2019-07-20 13:44:06.642085] INFO: derived_feature_extractor: 提取完成 rank_return_0/rank_return_5, 0.005s
[2019-07-20 13:44:06.651274] INFO: derived_feature_extractor: 提取完成 rank_return_5/rank_return_10, 0.008s
[2019-07-20 13:44:07.618887] INFO: derived_feature_extractor: /y_2018, 567450
[2019-07-20 13:44:08.901009] INFO: derived_feature_extractor: /y_2019, 353689
[2019-07-20 13:44:09.494090] INFO: bigquant: derived_feature_extractor.v3 运行完成[3.769289s].
[2019-07-20 13:44:09.503257] INFO: bigquant: dropnan.v1 开始运行..
[2019-07-20 13:44:10.819583] INFO: dropnan: /y_2018, 566142/567450
[2019-07-20 13:44:11.487141] INFO: dropnan: /y_2019, 352561/353689
[2019-07-20 13:44:11.668656] INFO: dropnan: 行数: 918703/921139
[2019-07-20 13:44:11.678602] INFO: bigquant: dropnan.v1 运行完成[2.175325s].
[2019-07-20 13:44:11.737041] INFO: bigquant: neutralize.v13 开始运行..
[2019-07-20 13:56:36.181391] INFO: bigquant: neutralize.v13 运行完成[744.444318s].

截面数据行业、市值中性化开始...
中性化计算完成...