Error in .__Task__col_roles(self = self, private = private, super = super, :
Assertion on ‘names of col_roles’ failed: Names must be a permutation of set {‘feature’,’target’,’name’,’order’,’stratum’,’group’,’weight’,’always_included’}, but has extra elements {‘original_ids’}.
This happened PipeOp colapply’s $train()
首先,XGBoost 仅接受数值型数据作为输入。虽然机器学习SE的xgboost模块内置了默认对因子型变量的自动转换功能(如将因子转为数值编码),也提供了独热编码(one-hot encoding)选项,但在某些情况下,默认的因子转数值方式可能导致模型运行出错。
为避免此类问题,建议在勾选“独热编码”选项,或在数据输入模型前手动将因子变量转换为数值型变量,以确保数据格式符合 XGBoost 的要求。
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容