CatBoostError:catboost / private / libs / target / target_converter.cpp:228:未知类标签:“ 197”

问题描述

我正在尝试将catboost模型拟合到我的数据中

#creating the model
model_cb = catboostClassifier(task_type='GPU',iterations=100,random_state=2020,eval_metric='F1')
#fitting the dataset into the model
model_cb.fit(X_train,y_train,cat_features= object_cols,plot=True,eval_set=(X_valid,y_valid))

但是当我运行代码时出现错误

catboostError: catboost/private/libs/target/target_converter.cpp:228: UnkNown class label: "676"

将我指向文档以了解错误

解决方法

这里是文档https://catboost.ai/docs/concepts/about.html

CatBoostClassifier(二进制分类器)期望y_train包含浮点数而不是字符串。

请注意,由于我们不会非常紧密地监视stackoverflow,因此最好在github.com/catboost/catboost上提问