Python Forum
xgboost,halvinggridsearchcv hyperparameters
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
xgboost,halvinggridsearchcv hyperparameters
#1
I am searching for best hyper parameters of XGBRegressor using HalvingGridSearchCV. Here is the code:

base_estimator = XGBRegressor(seed=1234,use_label_encoder=False,base_score=0.5,max_delta_step=0,
                              scale_pos_weight=1,nthread=12)

params = {'learning_rate': [0.2],
        'max_depth': [500],
         'min_child_weight': [50],
         'gamma': [1.5],
         'reg_alpha': [0.7],
        'reg_lambda':[50],
        'subsample':[1],
        'colsample_bytree': [0.5],
         'n_estimators':[1000]}

sh = HalvingGridSearchCV(base_estimator, param_grid=params, cv=5,
                         factor=2, max_resources=7926,resource='n_samples',
                         aggressive_elimination=True).fit(x_train, y_train,early_stopping_rounds=10,eval_metric='rmse', eval_set=[(x_test, y_test)], verbose=True)
     
print("Best: %f using %s" % (sh.best_score_, sh.best_params_))
Best: 0.058512 using {'colsample_bytree': 0.5, 'gamma': 1.5, 'learning_rate': 0.2, 'max_depth': 500, 'min_child_weight': 50, 'n_estimators': 1000, 'reg_alpha': 0.7, 'reg_lambda': 50, 'subsample': 1}

I've tried many options, but the result is still small, Can you help me and tell me why? Is anything bad in code or ? i do not know.

Thank you so much
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  XGboost Regressor output Scott 0 1,271 Mar-09-2020, 01:43 AM
Last Post: Scott

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020