我有一个预训练的保存模型,其中我告知了我的分类特征,在训练后进行正确的预测。现在我想再次在另一个上下文中使用它,但是我不知道如何恰当地告知分类特征。我尝试了这个:
model = CatBoostClassifier(cat_features=var_categ)
model.load_model('catmod.cat')
但是当我尝试预测时:
modelo.predict(base)
我遇到了这个错误:
CatBoostError: features data: pandas.DataFrame column 'cod_var1' has dtype 'category' but is not in cat_features list
是的,我仔细检查过,这一列确实在 var_categ 中。