通过 pandas_ml 调用时如何将权重向量添加到 xgboost

How to add weight vector to xgboost when calling via pandas_ml

在 xgboost 中,您可以将权重矩阵添加到数据矩阵(xgboost.DMatrix 的第四个参数):

http://xgboost.readthedocs.io/en/latest/python/python_api.html#module-xgboost.sklearn

调用xgboost bia时如何传递这个权重矩阵pandas_ml

http://pandas-ml.readthedocs.io/en/latest/xgboost.html

显然在 pandas_ml 中,xgboost 被称为 ModelFrame 上的一个方法,因此我假设我必须更改 ModelFrame 以识别权重列。 类似于目标数据的设置方式,有没有办法将另一列设置为权重列?

或者通过其他方式添加权重列?

与直接调用 xgboost 的方式完全相同:

clf = df.xgboost.XGBClassifier(weight=weight)