-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Description
Problem: The training target is boolean and the predicted target is string. When calling the score method, it throws an error.
catboost version: 1.0.3
Operating System: Windows 10
CPU: -
GPU: -
from catboost import CatBoostClassifier
import numpy as np
clf = CatBoostClassifier(silent=True)
clf.fit(np.array([[0,1,2],[2,3,4]]), np.array([[True],[False]]))
print(clf.predict(np.array([[0,1,2],[2,3,4]])))
clf.score(np.array([[0,1,2],[2,3,4]]), np.array([[True],[False]]))
Throwing the following error
CatBoostError Traceback (most recent call last)
----> 1 clf.score(np.array([[0,1,2],[2,3,4]]), np.array([[True],[False]]))
\my_env\lib\site-packages\catboost\core.py in score(self, X, y)
5032 raise CatBoostError('predicted classes have string type but specified y is numeric')
5033 elif np.issubdtype(y.dtype, np.bool_):
-> 5034 raise CatBoostError('predicted classes have string type but specified y is boolean')
5035 return np.mean(np.array(predicted_classes) == np.array(y))
5036
CatBoostError: predicted classes have string type but specified y is boolean
mlellouch, Samoed, ezekini-uala, oibrgmv and KarelZe