运行以下代码时:
import lightgbm as lgb
params = {'num_leaves': 38,
'min_data_in_leaf': 50,
'objective': 'regression',
'max_depth': -1,
'learning_rate': 0.1,
'device': 'gpu'
}
trn_data = lgb.Dataset(x_train, y_train)
val_data = lgb.Dataset(x_test, y_test)
model = lgb.train(params,
trn_data,
20000,
valid_sets=[trn_data, val_data],
verbose_eval=300,
early_stopping_rounds=1000)
我收到以下错误:
train() got an unexpected keyword argument 'verbose_eval'
train() got an unexpected keyword argument 'early_stopping_rounds'
值得注意的是,我是在 GPU 上运行它的。当在 CPU 上运行时,我没有收到此错误。
有人知道如何在 GPU 上运行 Lightgbm 时合并详细输出和提前停止回合吗?
最佳答案
关于GPU上的Lightgbm可以查看官方文档。在文档中没有 vebose_ecal 和 Early_stopping_rounds 这样的配置选项 Official Documentation
您也可以查看此链接Running LightGBM on GPU with python
关于python - 在 GPU 上运行 Lightgbm 时出现意外的关键字参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73346395/