1

我正在使用 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)
4

0 回答 0