Sckopt library gives error while tryin to use BayesSearchCV

256 Views Asked by At

Here is my code :

from skopt import BayesSearchCV 
import warnings
warnings.filterwarnings('ignore', message='The objective has been evaluated at this point before.')

params={'min_child_weight': (0, 50,),
        'max_depth': (0, 10),
        'subsample': (0.5, 1.0),
        'colsample_bytree': (0.5, 1.0),
        #'reg_lambda':(1e-5,100,'log-uniform'),
        #'reg_alpha':(1e-5,100,'log-uniform'),
        'learning-rate':(0.01,0.2,'log-uniform')
        }

bayes=BayesSearchCV(xgb.XGBRegressor(),params,n_iter=10,scoring='neg_mean_squared_error',cv=5,random_state=42)
res=bayes.fit(X_train,y_train)
print(res.best_params_)

My program only runs if i comment this three params, however if i leave them active it give me error:

ValueError: Not all points are within the bounds of the space.

How could I still include this params, and what is the reason why it denies to accept it ?

0

There are 0 best solutions below