I am using BayesSearchCV in order to find best HyperParameters using Bayssian Optimization. The syntax for using the BayesSearchCV looks like the following:
clas_model = LogisticRegression(max_iter=5000)
search_space =
{
"penalty": Categorical(['l1', 'l2', 'elasticnet', 'none']),
"solver": Categorical(['lbfgs', 'newton-cg', 'liblinear', 'sag', 'saga']),
"fit_intercept": Categorical([True, False])
}
bayes_search = BayesSearchCV(clas_model, search_space, n_iter=12, scoring="accuracy", n_jobs=-1, cv=5)
bayes_search.fit(X, y.values.ravel(), callback=on_step)
predictions_al = cross_val_predict(bayes_search, X, y.values.ravel(), cv=folds)
In this case, the solver 'newton-cg' does not accept penalty 'l1', so there is a dependency between hyperparameters. Is any way to configure this using this library?