LightGBM如何将feature_fraction转换为整数值?

他带来了和平

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

它使用地板或天花板功能吗?

我在文档中找不到它。(并略过GitHub上的源代码)

Doc说:

feature_fraction,默认= 1.0,类型= double,...,约束:0.0 <feature_fraction <= 1.0如果feature_fraction小于1.0,LightGBM将在每次迭代(树)中随机选择一个特征子集。例如,如果将其设置为0.8,LightGBM将在训练每棵树之前选择80%的特征。

如果我有三个功能,那feature_fraction = 0.5什么意思?每个决策树在每个拆分中使用多少个功能?1或2?

他带来了和平

我在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 integer value: number of features at each split
max_features = np.floor((feature_fraction * total_cnt) + 0.5) 

有关更多详细信息,请在此处查看

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章