我正在使用lightgbm运行交叉验证,并且在我的所有其他输入运行良好的情况下,使用一组输入看到以下错误。
LightGBMError: b'Label must be in [0, 3), but found -2147483648 in label'
我的所有输入x,y都是numpy数组,以下是我运行交叉验证的代码:
def cross_validate_lgbm():
lgbm_params = t4_params.copy()
lgbm_params['num_class'] = 3
# prepare data for lgbm
dset = lgbm.Dataset(x, y, silent = True)
# perform cross-validation
cv_results = lgbm.cv(lgbm_params, dset, num_boost_round=10000,
nfold=5, stratified=False, shuffle=True,
metrics='multi_logloss', early_stopping_rounds=100,
verbose_eval=50, show_stdv=True, seed=0)