Test time, let some features disabled. 预测的时候,让某些特征失效。(对我很重要,THANK YOU VERY MUCH)

比如我有100个特征,有个word2vec特征,预测的时候,我发现了word2vec词典外的词进来了(out-of-vocabulary),假设训练的时候,没有out-of-vocabulary。
这时我把这个word2vec的特征值设为0,可以使这个特征相当于失效了吗,仅仅其他99个特征起作用。
如果不是设0,有办法实现吗?

If I use wordvec as one feature, When out-of-vocab happens at test time, I set the wordvec feature value to 0 to disable the feature for the model. Is it possible?

I think you can set the missing value to indicate that the word2vec feature is missing. Use np.nan.

谢谢回复,您没理解我的意思哈,我不是防止输入xgboost的特征的值的nan问题,我是想让一维的特征彻底失效,就是xgboost认为没有这维特征了,预测的时候

I don’t think XGBoost can handle a feature that it has not seen at training time.