I am trying to run a GRIDSEARCHCV (sklearn) on XGBRegressor. Documentation on the parameter says that if regression, then objective = reg:squarederror
.(see https://github.com/dmlc/xgboost/tree/master/demo/regression) However, whenever I am trying to run the search, I am getting an error saying XGBoostError: b'[13:39:54] src/objective/objective.cc:23: Unknown objective function reg:squarederror
.
I am not sure how to get around this problem. For the sake of completeness, below is the piece of code I am using for this purpose.
cv_params = {
'n_estimators' : np.arange(100, 1201, 100),
'max_depth' : np.arange(2, 10)
}
xgbr_params = {'objective':'reg:squarederror','n_jobs':-1,'random_state':4444,'min_child_weight':1,
'eta':0.3,'subsample':0.8,'gamma':0.5,'colsample_bytree':0.8}
opt_xgbr = GridSearchCV(xgb.XGBRegressor(**xgbr_params)
,param_grid=cv_params,scoring='r2',cv=5,n_jobs=-1,return_train_score=True, verbose=3)
Any help would be greatly appreciated.
Thanks
import xgboost as xgb; xgb.__version__
$\endgroup$