从零开始弄懂LightGBM_参数篇

本文详细介绍了LightGBM的官方参数,包括boosting_type、num_leaves、max_depth等,并提供了参数优化建议,如控制过拟合、提升训练速度和准确率的方法。此外,还提到了使用Hyperopt进行自动调参以及LightGBM原生接口和scikit-learn接口的使用示例。
摘要由CSDN通过智能技术生成

LightGBM 英文文档:https://lightgbm.readthedocs.io/en/latest/index.html
LightGBM 中文文档:https://lightgbm.apachecn.org/
LightGBM 原理可参考:深入理解LightGBM https://blog.csdn.net/program_developer/article/details/103838846

LightGBM是一款快速、分布式、高性能的基于决策树的梯度 Boosting 框架。可用于排序、分类、回归等机器学习任务中。

 

官方参数

以Scikit-learn API 的 LGBMRegressor 为例

# Scikit-learn API
class lightgbm.LGBMRegressor(boosting_type='gbdt', num_leaves=31, max_depth=-1, 
learning_rate=0.1, n_estimators=10, max_bin=255, subsample_for_bin=200000, objective=None, 
min_split_gain=0.0, min_child_weight=0.001, min_child_samples=20, subsample=1.0, 
subsample_freq=1, colsample_bytree=1.0, reg_alpha=0.0, reg_lambda=0.0, random_state=None, 
n_jobs=-1, silent=True, **kwargs)

boosting_type (string__, optional (default="gbdt")) – ‘gbdt’, traditional Gradient Boosting Decision Tree. ‘dart’, Dropouts meet Multiple Additive Regression Trees. ‘goss’, Gradient-based One-Side Sampling. ‘rf’, Random Forest.
默认的就挺好

num_leaves (int__, optional (default=31)) – Maximum tree leaves for base learners.
每个基学习器的最大叶子节点。LightGBM 使用的是 leaf-wise 的算法,因此在调节树的复杂程度时使用的是 num_leaves,它的值的设置应该小于 2^(max_depth)

max_depth (int__, optional (default=-1)) – Maximum tree depth for base learners, -1 means no limit.
每个基学习器的最大深度。当模型过拟合,首先降低max_depth 

learning_rate (float__, optional (default=0.1)) – Boosting learning rate.
梯度下降的步长。常用 0.1, 0.001, 0.003

n_estimators (int__, optional (default=10)) – Number of boosted trees to fit.
基学习器的数量 </

  • 9
    点赞
  • 90
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值