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
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?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With