Skip to content
This repository was archived by the owner on Feb 28, 2024. It is now read-only.
This repository was archived by the owner on Feb 28, 2024. It is now read-only.

integer lower_bound and upper_bound result in ignoring "prior", and bug if are not of the same type #1065

@Abdelgha-4

Description

@Abdelgha-4

In skopt.Optimizer docs it said:

  • a (lower_bound, upper_bound, "prior") tuple (for Real dimensions), ...

however if lower_bound and upper_bound are integers it generate an Integer dimension
a reproduceable example:

from skopt import BayesSearchCV
from sklearn.datasets import load_iris
from sklearn.svm import SVC

X, y = load_iris(return_X_y=True)

searchcv = BayesSearchCV(
    SVC(gamma='scale'),
    search_spaces={'C': (1, 100, 'log-uniform')},
    n_iter=10,
    cv=5,
    scoring='f1_macro',
    random_state=42
)
searchcv.fit(X, y)
print(searchcv.cv_results_['param_C'])

it shows a list of integer values.
Another bug:
with the same code above, when replacing (1, 100, 'log-uniform') with (1.1, 100, 'log-uniform'), it produce a ValueError: All values shouldbe greater than 0.041393

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions