昨天我用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,2means column_0, column_1 and column_2 are categorical features - add a prefix
name:for column name, e.g.categorical_feature=name:c1,c2,c3means c1, c2 and c3 are categorical features - Note: only supports categorical with
inttype - Note: i

本文介绍了在使用LightGBM进行小数据集回归预测时,直接处理标签特征与哑编码的效果比较。在数据集中,标签特征为当周第几天和当月第几天。实验结果显示,虽然直接使用LightGBM的标签特征参数相比将标签特征转化为定量特征有微小提升,但OneHotEncoder编码后的预测准确率更高。对于标签特征重要且数量较多的情况,作者建议尝试CatBoost模型,并计划进行后续研究。
最低0.47元/天 解锁文章
4761





