2

I am trying to execute hyperband on XGBoost model as shown below, but I get this error message:

AttributeError: 'HyperbandSearchCV' object has no attribute '_get_param_iterator'

][1]

The code I am using to run hyperband is:

import xgboost as xgb

hb_xgb_model = xgb.XGBClassifier()

xgb_hb_param_dict = {'max_depth' : np.arange(3, 501),
                    'learning_rate' : np.arange(0.001, 0.1),
                    'n_estimators' : np.arange(50, 501),
                    'objective' : ['binary:logistic']
                    }


import hyperband
from hyperband import HyperbandSearchCV

xgb_search = HyperbandSearchCV(hb_xgb_model, xgb_hb_param_dict, cv=3,
                           verbose = 1,
                           max_iter=200,min_iter=50)

xgb_search.fit(x_train,y_train) 
dspencer
  • 4,297
  • 4
  • 22
  • 43
Piu
  • 21
  • 3
  • I have added the screenshot of the error. – Piu Mar 13 '20 at 14:38
  • import xgboost as xgb hb_xgb_model = xgb.XGBClassifier() xgb_hb_param_dict = {'max_depth' : np.arange(3, 501), 'learning_rate' : np.arange(0.001, 0.1), 'n_estimators' : np.arange(50, 501), 'objective' : ['binary:logistic'] } import hyperband from hyperband import HyperbandSearchCV xgb_search = HyperbandSearchCV(hb_xgb_model, xgb_hb_param_dict, cv=3, verbose = 1, max_iter=200,min_iter=50) xgb_search.fit(x_train,y_train) – Piu Mar 13 '20 at 14:41
  • sorry for the inconvenience. I have formatted the code. Hope this helps. – Piu Mar 13 '20 at 14:59
  • did you ever find a solution to this? – Dave Liu Oct 26 '20 at 22:28

0 Answers0