4

I'm dealing with this warning:

[20:16:09] WARNING: ../src/learner.cc:541: 
Parameters: { scale_pos_weight } might not be used.

  This may not be accurate due to some parameters are only used in language bindings but
  passed down to XGBoost core.  Or some parameters are not used but slip through this
  verification. Please open an issue if you find above cases.

while training an XGBoost in Python.

I've been researching about it, it's due to the classification type (binary or multiclass). The thing is that I'm doing binary classification over unbalanced data (6483252 negative / 70659 positive), so I need to set that parameter in order to consider this unbalance during training, but I don't understand why I'm getting that warning :(

This is how I'm initializing and training the XGBoost:

param = {'n_jobs':-1, 'random_state':5, 'booster':'gbtree', 'seed':5, 'objective': 'binary:hinge',  'scale_pos_weight':ratio}
param['eval_metric'] = ['auc', 'aucpr', 'rmse', 'error']

xgb_clf =xgb.XGBClassifier(**param)
xgb_clf.fit(dtrain,y_train)

dtrain is a pandas dataframe and y_train is a pandas series with the labels (0,1).

Thanks!

sooaran
  • 183
  • 1
  • 2
  • 13

1 Answers1

1

possible fix are 2:

  • Your training set is multiclass and then the parameter is not valid.
  • n_jobs problem in the implementation (set n_jobs to 0)

this are the most common problems

Marco Visibelli
  • 359
  • 3
  • 7