【问题标题】:How to add weight vector to xgboost when calling via pandas_ml通过 pandas_ml 调用时如何向 xgboost 添加权重向量
【发布时间】:2018-09-15 07:23:33
【问题描述】:

在 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 来识别权重列。 与如何设置目标数据类似,有没有办法可以将另一列设置为权重列?

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

【问题讨论】:

    标签: scikit-learn xgboost sklearn-pandas


    【解决方案1】:

    您的操作方式与直接调用 xgboost 时完全相同:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-18
      • 1970-01-01
      • 2017-11-01
      相关资源
      最近更新 更多