Questions tagged [bayessearchcv]

20 questions
3
votes
1 answer

Error when trying to tune MLPClassifier hidden_layer_sizes using BayesSearchCV

When trying to tune the sklearn MLPClassifier hidden_layer_sizes hyper parameter, using BayesSearchCV, I get an error: ValueError: can only convert an array of size 1 to a Python scalar. However, when I use GridSearchCV, it works great! What am I…
onofricamila
  • 930
  • 1
  • 11
  • 20
2
votes
2 answers

How to fix the 'numpy.int' attribute error when using skopt.BayesSearchCV in scikit-learn?

When I run the following code on the official documentation, it has an error. Minimal example from skopt import BayesSearchCV from sklearn.datasets import load_digits from sklearn.svm import SVC from sklearn.model_selection import…
2
votes
1 answer

BayesSearchCV is not working during SGDClassifier parameter tuning

I am trying to use BayesSearchCV for the parameter tuning of the SGDClassifier. Below is my code which I tried. import seaborn from sklearn.preprocessing import LabelEncoder from sklearn.model_selection import train_test_split from skopt import…
BC Smith
  • 727
  • 1
  • 7
  • 19
1
vote
0 answers

unhashable type: 'dict' when sampling values for class_weight in BayesSearchCV

I'm trying to tune the hyperparameters of a model using BayesSearchCV. This model have a class_weight parameter which is associated with classes in the form {class_label: weight}. The problem is I'm getting a unhashable type: 'dict' error message…
1
vote
0 answers

Bayes () Function

Hi can I get an example of what the following code should be using different figures: "Write a bayes() function that can be used to calculate the posterior probability of an event A, given the known outcome of event B and the prior probability of A,…
1
vote
1 answer

Error using BayesSearchCV from skopt on RandomForestClassifier

this is the code to reproduce the error: from sklearn.ensemble import RandomForestClassifier from sklearn.linear_model import LogisticRegression from scipy.stats import loguniform from skopt import BayesSearchCV from sklearn.datasets…
Will
  • 1,619
  • 5
  • 23
1
vote
0 answers

BayesSearchCV: Continuous/Real Hyperparameter Dependency

In attempting to use BayesSearchCV from the skopt library, I have two feature distributions that are dependent on one another, such that par_B must be > par_A Is there an efficient way to do this within a Real search space? I have tried the…
1
vote
1 answer

How does n_points in skopt BayesSearchCV work?

I am confused on how does n_points work in skopt BayesSearchCV. As I understood, Bayes Search is sequential. But in skopt BayesSearchCV, we can set n_point parameter which specifies the number of parameter settings to sample in parallel. How does…
YHD
  • 11
  • 1
1
vote
2 answers

BayesSearchCV TypeError: '<' not supported between instances of 'Version' and 'tuple'

I'm working on the Kaggle Titanic dataset. I'm trying to use LightGBM's LGBMClassifier to determine if a given passenger survived. I've created a pipeline for filling in and processing all of the data and am trying to use BayesSearchCV to optimize…
LucaHassan
  • 11
  • 2
1
vote
1 answer

Adding 0 to log-uniform parameter distribution in BayesSearchCV

I'm using scikit-optimize to do a BayesSearchCV within my RandomForestClassifier hyperparameter space. One hyperparameter is supposed to also be 0 (zero) while having a log-uniform distribution: ccp_alpha = Real(min(ccp_alpha), max(ccp_alpha),…
m3ph
  • 53
  • 6
1
vote
1 answer

Example of using a KerasRegressor in scikit-optimize

I am using the awesome scikit-optimize toolbox for hyperparameter optimization. My goal is to compare keras and scikit-learn models. According to the example…
0
votes
0 answers

How to solve this issues "AssertionError: Must have at least 1 validation dataset for early stopping"

I am developing a propensity scorecard model in xgboost in 1.6.2 version and while running below code it gives me errors. I searched lots of relevant question on stack overflow but wasn't able to find best solution. how to change it in my code? from…
0
votes
0 answers

GridSearchCV: How can I limit my param_grid to only include a small range for learning_rate * n_estimators

I am currently searching a grid with learning_rate between 0.001 and 0.02 and n_estimators between 200 and 4,000. But I know that all the good results are with learning_rate * n_estimators close to 4. Is there a way to specify only the learning_rate…
0
votes
1 answer

BayesSearchCV of LGBMregressor: how to weight samples in both training and CV scoring?

While optimizing LightGBM hyperparameters, I'd like to individually weight samples during both training and CV scoring. From the BayesSearchCV docs, it seems that a way to do that could be to insert a LGBMregressor sample_weight key into the…
glmorous
  • 149
  • 1
  • 5
0
votes
1 answer

Error while hyperparameter tuning using BayesSearchCV for CatBoostClassifier (Multiclass classification)

I am trying to tune hyperparameters for Multiclassclassification with CatBoostClassifier but getting below error. ValueError: multiclass format is not supported My target variable contains (0,1,2,3) Please check below code that I have implemented. …
1
2