Skip to content

Commit 7c84390

Browse files
committed
Remove tqdm dependency, use EI acq
1 parent 9543fb8 commit 7c84390

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/typed_hyperparameter_tuning.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from sklearn.model_selection import KFold
66
from sklearn.metrics import log_loss
77
import matplotlib.pyplot as plt
8-
from tqdm import tqdm
98

109
N_FOLDS = 10
1110
N_START = 2
@@ -34,7 +33,8 @@
3433

3534
METRIC_SIGN = -1
3635

37-
for i, (train_idx, test_idx) in enumerate(tqdm(kfold.split(data.data), total=N_FOLDS)):
36+
for i, (train_idx, test_idx) in enumerate(kfold.split(data.data)):
37+
print(f'Fold {i + 1}/{N_FOLDS}')
3838
def gboost(log_learning_rate, max_depth, min_samples_split):
3939
clf = GradientBoostingClassifier(
4040
n_estimators=10,
@@ -50,13 +50,15 @@ def gboost(log_learning_rate, max_depth, min_samples_split):
5050
continuous_optimizer = BayesianOptimization(
5151
f=gboost,
5252
pbounds=continuous_pbounds,
53+
acquisition_function=acquisition.ExpectedImprovement(xi=1e-2, random_state=42),
5354
verbose=0,
5455
random_state=42,
5556
)
5657

5758
discrete_optimizer = BayesianOptimization(
5859
f=gboost,
5960
pbounds=discrete_pbounds,
61+
acquisition_function=acquisition.ExpectedImprovement(xi=1e-2, random_state=42),
6062
verbose=0,
6163
random_state=42,
6264
)

0 commit comments

Comments
 (0)