【问题标题】:How does LightGBM convert feature_fraction to an integer value?LightGBM 如何将 feature_fraction 转换为整数值?
【发布时间】:2021-05-18 19:05:53
【问题描述】:

有谁知道 lightgbm 如何将 feature_fraction 参数(用户定义为 0.8 等非整数)转换为整数值?

它使用的是地板还是天花板功能?

我在文档中找不到它。 (以及浏览 GitHub 上的源代码)

文档说:

feature_fraction , 默认 = 1.0, type = double, ... , 约束:0.0

如果我有三个功能,feature_fraction = 0.5 是什么意思?每个决策树在每次拆分时使用多少个特征? 1 还是 2?

【问题讨论】:

    标签: python machine-learning lightgbm boosting


    【解决方案1】:

    我在 microsoft/LightGBM GitHub 上提出了这个问题。 LightGBM 将使用这个公式进行转换,比如在 Python 中:

    total_cnt = 3 # I have three features
    
    # I like my decision trees use 50 % of features at each split 
    feature_fraction = 0.5 
    
    # this is the integer value: number of features at each split
    max_features = np.floor((feature_fraction * total_cnt) + 0.5) 
    

    更多详情请查看here

    【讨论】:

      猜你喜欢
      • 2022-10-23
      • 2022-09-27
      • 2016-06-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-01
      相关资源
      最近更新 更多