【发布时间】:2020-02-20 00:20:43
【问题描述】:
假设我的数据只有 1 列分类特征(已经转换为 astype(int)),
x_to_use = x_to_use.astype(int)
我在 sklearn 管道中使用它:
LGBMRegressor(**{
"n_estimators":100,
"categorical_feature":(0,),
"max_depth":1,
}
我收到了这个警告。
c:\programdata\miniconda3\lib\site-packages\lightgbm\basic.py:842: UserWarning: categorical_feature keyword has been found in `params` an
Please use categorical_feature argument of the Dataset constructor to pass this parameter.
我希望所有内容都采用标准 sklearn 机器学习管道格式,因此我的输入始终是 np.array。我的管道构造是否正确或者是“categorical_feature”:(0,),只是被忽略并且该列不被视为分类。
编辑:
好的...我构造了一个简单的测试,“categorical_feature”实际上使用正确。
【问题讨论】:
-
ok...我构建了一个简单的测试,它确实可以正确处理“categorical_feature”。
标签: python scikit-learn lightgbm