问题描述
有谁知道lightgbm如何将feature_fraction
参数(由用户定义为0.8等非整数)转换为整数值?
它使用地板还是天花板功能?
我在文档中找不到它。 (以及浏览 GitHub 上的源代码)
医生说:
feature_fraction
,default = 1.0,type = double,...,约束:0.0
如果我有三个特征,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)
有关详细信息,请查看 here。