昨天我用LightGBM对一个小数据集进行了回归预测,其中特征部分包含定性特征(标签特征),因为在LightGBM官方文档中看到LightGBM可以通过‘categorical_feature’参数直接处理标签特征,而且计算速度更快,效果更佳。
文档参数说明如下:
categorical_feature
?︎, default = ""
, type = multi-int or string, aliases: cat_feature
, categorical_column
, cat_column
- used to specify categorical features
- use number for index, e.g.
categorical_feature=0,1,2
means column_0, column_1 and column_2 are categorical features - add a prefix
name:
for column name, e.g.categorical_feature=name:c1,c2,c3
means c1, c2 and c3 are categorical features - Note: only supports categorical with
int
type - Note: ind