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

How does LightGBM convert feature_fraction to an integer value?

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

是用floor还是ceiling功能?

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

文档说:

feature_fraction , default = 1.0, type = double, ... , constraints: 0.0 < feature_fraction <= 1.0 LightGBM will randomly select a subset of features on each iteration (tree) if feature_fraction is smaller than 1.0. For example, if you set it to 0.8, LightGBM will select 80% of features before training each tree.

如果我有三个特征,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 the integer value: number of features at each split
max_features = np.floor((feature_fraction * total_cnt) + 0.5) 

更多详情请查看here