I am trying to tune hyperparameters for Multiclassclassification with CatBoostClassifier but getting below error.
ValueError: multiclass format is not supported
My target variable contains (0,1,2,3)
Please check below code that I have implemented.
accuracy = make_scorer(accuracy_score, greater_is_better=True, needs_threshold=True)
skf = StratifiedKFold(n_splits=5, shuffle=True, random_state=42)
clf = CatBoostClassifier(thread_count=2, loss_function='MultiClass', eval_metric='Accuracy', leaf_estimation_method='Newton', od_type = 'Iter', verbose= False)
# Defining your search space
search_spaces = {'iterations': Integer(10, 2000),
'depth': Integer(1, 12),
'learning_rate': Real(0.01, 1.0, 'log-uniform'),
'random_strength': Real(1e-9, 10, 'log-uniform'),
'bagging_temperature': Real(0.0, 1.0),
'border_count': Integer(1, 255),
'l2_leaf_reg': Integer(2, 30)}
# Setting up BayesSearchCV
opt = BayesSearchCV(clf,
search_spaces,
scoring=accuracy,
cv=skf,
n_iter=100,
n_jobs=1,
return_train_score=False,
refit=True,
optimizer_kwargs={'base_estimator': 'GP'},
random_state=42)
opt.fit(X_train, y_train)
Please let me know if more detail is required regarding my question. Please help me to get this issue resolved. Thanks!