You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.
I have a list of tuples that I would like to cross-validate over, e.g. [(1,), (2,), (1,2)]. Providing this as the value for a key in the search_space parameter dictionary that I pass to BayesSearchCV causes an error however when I call fit():
Traceback (most recent call last):
File "/path/to/conda/envlib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/path/to/conda/envlib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/path/to/src/main.py", line 256, in <module>
main()
File "/path/to/src/main.py", line 229, in main
opt.fit(X_train, y=y_train)
File "/path/to/conda/envlib/python3.7/site-packages/skopt/searchcv.py", line 680, in fit
groups=groups, n_points=n_points_adjusted
File "/path/to/conda/envlib/python3.7/site-packages/skopt/searchcv.py", line 555, in _step
params = [[np.array(v).item() for v in p] for p in params]
File "/path/to/conda/envlib/python3.7/site-packages/skopt/searchcv.py", line 555, in <listcomp>
params = [[np.array(v).item() for v in p] for p in params]
File "/path/to/conda/envlib/python3.7/site-packages/skopt/searchcv.py", line 555, in <listcomp>
params = [[np.array(v).item() for v in p] for p in params]
ValueError: can only convert an array of size 1 to a Python scalar
I am using the following packages:
scikit-learn 0.22.2.post1
scikit-optimize 0.7.4
This is the dictionary I'm passing to BayesSearchCV:
It is interesting to note that this problem does not occur if I use GridSearchCV instead of BayesSearchCV. I've managed to find a work-around by simply wrapping the tuples inside my own class, but it would be nice to get it to work as usual.
The text was updated successfully, but these errors were encountered:
I have a list of tuples that I would like to cross-validate over, e.g.
[(1,), (2,), (1,2)]
. Providing this as the value for a key in the search_space parameter dictionary that I pass toBayesSearchCV
causes an error however when I callfit()
:I am using the following packages:
scikit-learn 0.22.2.post1
scikit-optimize 0.7.4
This is the dictionary I'm passing to BayesSearchCV:
It is interesting to note that this problem does not occur if I use
GridSearchCV
instead ofBayesSearchCV
. I've managed to find a work-around by simply wrapping the tuples inside my own class, but it would be nice to get it to work as usual.The text was updated successfully, but these errors were encountered: