tuning xgboost classifier hyperparams, raises a exception

### Describe the bug

I am trying to classify patients into those who have diabetes and those who do not, with xgboost and scikit-learn library. The dataset is from [kaggle](https://www.kaggle.com/datasets/cjboat/diabetes2).

**To not depend on external data files here, I copied the first lines of the dataset to the code.
But the same error occurs when running on all the data.**

The Y column is "Outcome", and contains 0 or 1.

when tuning the hyperparameters, I get an error in the last line of code:

`Check failed: label_error >= 0 && label_error < static_cast<int32_t>(n_class): MultiClassEvaluation: label must be in [0, num_class), num_class=1 but found 1 in label.`

### Steps/Code to Reproduce

```
    
import pandas as pd
import numpy as np
import xgboost as xgb
from sklearn.model_selection import train_test_split
from skopt import BayesSearchCV
from sklearn.model_selection import KFold
import io

dataset = """Pregnancies,Glucose,BloodPressure,SkinThickness,Insulin,BMI,DiabetesPedigreeFunction,Age,Outcome
6,148,72,35,0,33.6,0.627,50,1
1,85,66,29,0,26.6,0.351,31,0
8,183,64,0,0,23.3,0.672,32,1
1,89,66,23,94,28.1,0.167,21,0
0,137,40,35,168,43.1,2.288,33,1
5,116,74,0,0,25.6,0.201,30,0
3,78,50,32,88,31,0.248,26,1
10,115,0,0,0,35.3,0.134,29,0
2,197,70,45,543,30.5,0.158,53,1
8,125,96,0,0,0,0.232,54,1
4,110,92,0,0,37.6,0.191,30,0
10,168,74,0,0,38,0.537,34,1
10,139,80,0,0,27.1,1.441,57,0
1,189,60,23,846,30.1,0.398,59,1
5,166,72,19,175,25.8,0.587,51,1
7,100,0,0,0,30,0.484,32,1
0,118,84,47,230,45.8,0.551,31,1
7,107,74,0,0,29.6,0.254,31,1
1,103,30,38,83,43.3,0.183,33,0
1,115,70,30,96,34.6,0.529,32,1
3,126,88,41,235,39.3,0.704,27,0
8,99,84,0,0,35.4,0.388,50,0
7,196,90,0,0,39.8,0.451,41,1
9,119,80,35,0,29,0.263,29,1"""

df = pd.read_csv(io.StringIO(dataset), sep=",")
X_train, X_test, y_train, y_test = train_test_split(df, df["Outcome"], test_size=0.25)

params = {'max_depth': [3, 4, 5, 6, 7, 8, 9, 10, 15, 20],
          'num_class': np.arange(2)}

xgbr = xgb.XGBClassifier(enable_categorical=True, tree_method='hist')
# xgbr.fit(X_train, y_train)
# result = xgbr.predict(X_test) # works great!

kfold = KFold(n_splits=3)
search = BayesSearchCV(estimator=xgbr,
                       search_spaces=params,
                       scoring='neg_mean_squared_error',
                       n_iter=25,
                       verbose=0)

eval_set = [(X_test, y_test)]
result = search.fit(X_train, y_train, early_stopping_rounds=10, eval_metric="mlogloss",
                    eval_set=eval_set)  # ERROR!!

```

### Expected Results

No error thrown

### Actual Results

```
Check failed: label_error >= 0 && label_error < static_cast<int32_t>(n_class): MultiClassEvaluation: label must be in [0, num_class), num_class=1 but found 1 in label.
```

### Versions

```shell
System:
    python: 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)]
executable: D:\code\python\ml\venv\Scripts\python.exe
   machine: Windows-10-10.0.22000-SP0

Python dependencies:
      sklearn: 1.1.1
          pip: 21.3.1
   setuptools: 60.2.0
        numpy: 1.23.0
        scipy: 1.8.1
       Cython: 0.29.30
       pandas: 1.4.3
   matplotlib: 3.5.2
       joblib: 1.1.0
threadpoolctl: 3.1.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: D:\code\python\ml\venv\Lib\site-packages\numpy\.libs\libopenblas.FB5AE2TYXYH2IJRDKGDGQ3XBKLKTF43H.gfortran-win_amd64.dll
        version: 0.3.20
threading_layer: pthreads
   architecture: Zen
    num_threads: 12

       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: D:\code\python\ml\venv\Lib\site-packages\scipy\.libs\libopenblas.XWYDX2IKJW2NMTWSFYNGFUWKQU3LYTCZ.gfortran-win_amd64.dll
        version: 0.3.17
threading_layer: pthreads
   architecture: Zen
    num_threads: 12

       user_api: openmp
   internal_api: openmp
         prefix: vcomp
       filepath: D:\code\python\ml\venv\Lib\site-packages\sklearn\.libs\vcomp140.dll
        version: None
    num_threads: 12
```

COMMENT:
Hi @zaalgol - Are you sure the bug is here in `scikit-learn`? 

I took a look at this and to me it seems that the error source may be in the `xgboost` package rather than here. The specific error you cite seems to occur in `xgboost` at the following location: `src/metric/multiclass_metric.cu`. 

If it is the case that the error source is in `xgboost`, perhaps you can try filing an issue there: [xgboost issues](https://github.com/dmlc/xgboost/issues)

Labels: Bug, Needs Triage