朵小喵儿|LightGBM的参数详解以及如何调优( 五 )

使用您选择的超参数优化库(例如scikit-optimize) 。
neptune.init('mjbahmani/LightGBM-hyperparameters')neptune.create_experiment('lgb-tuning_final', upload_source_files=['*.*'],tags=['lgb-tuning', 'dart'],params=SEARCH_PARAMS)SPACE = [skopt.space.Real(0.01, 0.5, name='learning_rate', prior='log-uniform'),skopt.space.Integer(1, 30, name='max_depth'),skopt.space.Integer(10, 200, name='num_leaves'),skopt.space.Real(0.1, 1.0, name='feature_fraction', prior='uniform'),skopt.space.Real(0.1, 1.0, name='subsample', prior='uniform')]@skopt.utils.use_named_args(SPACE)def objective(**params):return -1.0 * train_evaluate(params)monitor = sk_utils.NeptuneMonitor()results = skopt.forest_minimize(objective, SPACE,n_calls=100, n_random_starts=10,callback=[monitor])sk_utils.log_results(results)neptune.stop()注 , 本文代码使用了neptune.ai平台 , 所以有一些neptune的api
完整代码在这里 ;utmsource=medium&utmmedium=crosspost&utm_campaign=blog-lightgbm-parameters-guide
尝试不同类型的配置并在Neptune中跟踪结果
朵小喵儿|LightGBM的参数详解以及如何调优最后 , 在下表中 , 您可以看到参数中发生了什么变化 。
朵小喵儿|LightGBM的参数详解以及如何调优总结长话短说 , 您了解到:
1. lightgbm的主要参数是什么 ,
1. 如何使用feval函数创建自定义指标
1. 主要参数的默认值是多少
1. 看到了如何调整lightgbm参数以改善模型性能的示例
作者:Kamil Kaczmarek
deephub 翻译组


推荐阅读