Skip to content

Commit 094322d

Browse files
improved imports and related error message
1 parent 3a98dd7 commit 094322d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kernel_tuner/strategies/bayes_opt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
import itertools
55
import warnings
66
import time
7+
from typing import Tuple
78

89
import numpy as np
10+
from scipy.stats import norm
911

1012
# BO imports
1113
try:
12-
from typing import Tuple
13-
from scipy.stats import norm
1414
from sklearn.gaussian_process import GaussianProcessRegressor
1515
from sklearn.gaussian_process.kernels import ConstantKernel, RBF, Matern
1616
from sklearn.exceptions import ConvergenceWarning
@@ -94,7 +94,7 @@ def tune(runner, kernel_options, device_options, tuning_options):
9494
max_fevals = tuning_options.strategy_options.get("max_fevals", 100)
9595
prune_parameterspace = tuning_options.strategy_options.get("pruneparameterspace", True)
9696
if not bayes_opt_present:
97-
raise ImportError("Error: optional dependencies for Bayesian Optimization not installed")
97+
raise ImportError("Error: optional dependencies for Bayesian Optimization not installed, please install scikit-learn and scikit-optimize")
9898

9999
# epsilon for scaling should be the evenly spaced distance between the largest set of parameter options in an interval [0,1]
100100
tune_params = tuning_options.tune_params

0 commit comments

Comments
 (0)