Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XGBoost error - Unknown objective function reg:squarederror

I am training a xgboost model for regression task and I passed the following parameters -

params = {'eta':0.4, 'max_depth':5, 'colsample_bytree':0.6, 'objective':'reg:squarederror'}
num_round = 10
xgb_model = xgboost.train(params, dtrain_x, num_round)

In the training phase I get the following error-

XGBoostError: b'[18:03:23] C:\Users\xgboost\src\objective\objective.cc:23: Unknown objective function reg:squarederror'

While in the docs, it is clearly a valid objective function. Can anyone tell me why am I getting this error?

INFO- I am using python 3.7.3 on windows and xgboost version is 0.82

like image 678
Ankit Seth Avatar asked May 21 '19 05:05

Ankit Seth


1 Answers

xgb_model = xgboost.train(**params, dtrain_x, num_round)

This would work for all versions. It is the way to pass **kwargs as a dictionary.

What does ** (double star/asterisk) and * (star/asterisk) do for parameters?

like image 91
T.singh Avatar answered Oct 03 '22 22:10

T.singh