1

In xgboost you can add a weight matrix to the data matrix (fourth argument of xgboost.DMatrix):

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

How can I pass this weight matrix when calling xgboost bia pandas_ml

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

Obviously in pandas_ml xgboost is called as a method on the ModelFrame so I assume that I have to change the ModelFrame to identify the weight column. Analogously to how the target data is set is there a way you can set another column to be the weight column?

Or some other way to add the weight column?

Bazman
  • 2,058
  • 9
  • 45
  • 65

1 Answers1

2

You do it exactly the same way as when you are calling xgboost directly:

clf = df.xgboost.XGBClassifier(weight=weight)
TYZ
  • 8,466
  • 5
  • 29
  • 60