-
Notifications
You must be signed in to change notification settings - Fork 453
Open
Description
I got the error "The 'bootstrap' parameter of cross_val_predict must be an instance of 'bool' or an instance of 'numpy.bool_'. Got 0 instead." when running
from sklearn.ensemble import RandomForestRegressor
from sklearn.metrics import r2_score, mean_squared_error
from hebo.sklearn_tuner import sklearn_tuner
from sklearn.datasets import fetch_california_housing
data = fetch_california_housing()
X, y = data.data, data.target
space_cfg = [
{'name' : 'max_depth', 'type' : 'int', 'lb' : 1, 'ub' : 20},
{'name' : 'min_samples_leaf', 'type' : 'num', 'lb' : 1e-4, 'ub' : 0.5},
{'name' : 'max_features', 'type' : 'cat', 'categories' : ['auto', 'sqrt', 'log2']},
{'name' : 'bootstrap', 'type' : 'bool'},
{'name' : 'min_impurity_decrease', 'type' : 'pow', 'lb' : 1e-4, 'ub' : 1.0},
]
result = sklearn_tuner(RandomForestRegressor, space_cfg, X, y, metric = r2_score, max_iter = 16)
The sklearn version is 1.6.1. I believe it may be because in line 35 of bool_param.py
, the bool variable is treated as numeric, and then in line 79 of sklearn_tuner.py
it changes the bool to int.
Metadata
Metadata
Assignees
Labels
No labels