Catboost: Problem with multiclass

Created on 18 Jul 2017  路  3Comments  路  Source: catboost/catboost

clf = cb.CatBoostClassifier()
score = cross_val_score(clf,x_train2,y,cv=5,scoring='neg_log_loss')
score.mean()

/usr/local/lib/python2.7/dist-packages/catboost/core.pyc in _fit(self, X, y, cat_features, sample_weight, baseline, use_best_model, eval_set, verbose, plot)
386 raise ImportError(e.message)
387 with log_fixup():
--> 388 self._train(X, eval_set, params)
389 if calc_feature_importance:
390 setattr(self, "feature_importance", self.feature_importances(X))

_catboost.pyx in _catboost._CatBoostBase._train (/home/rnefyodov/.ya/build/build_root/7466703371396a7832336d7773326674/catboost/python-package/catboost/_catboost.pyx.cpp:13630)()

_catboost.pyx in _catboost._CatBoost._train (/home/rnefyodov/.ya/build/build_root/7466703371396a7832336d7773326674/catboost/python-package/catboost/_catboost.pyx.cpp:9713)()

_catboost.pyx in _catboost._CatBoost._train (/home/rnefyodov/.ya/build/build_root/7466703371396a7832336d7773326674/catboost/python-package/catboost/_catboost.pyx.cpp:9507)()

CatboostError: catboost/libs/algo/train_model.cpp:109: All targets are greater than border

Most helpful comment

For multiclass use loss_function='MultiClass'
clf = cb.CatBoostClassifier(loss_function='MultiClass')

All 3 comments

For multiclass use loss_function='MultiClass'
clf = cb.CatBoostClassifier(loss_function='MultiClass')

Thx

Thanks. It worked for the multiclass now.

Was this page helpful?
0 / 5 - 0 ratings