Skip to content

Commit a3b2583

Browse files
committed
Fix errors in Bayesian Optimization Colab notebook
1 parent 22c0c6c commit a3b2583

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

bayesian-optimization/bayesian_optimization.ipynb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@
1616
"try:\n",
1717
" # Check if notebook is running in Google Colab\n",
1818
" import google.colab\n",
19+
" !pip install matplotlib==3.1.3\n",
1920
" # Get additional files from Github\n",
2021
" !wget https://raw.githubusercontent.com/krasserm/bayesian-machine-learning/dev/bayesian-optimization/bayesian_optimization_util.py\n",
2122
" # Install additional dependencies\n",
22-
" !pip install scikit-optimize==0.5.2\n",
23-
" !pip install GPy==1.9.8\n",
24-
" !pip install GPyOpt==1.2.1\n",
25-
" !pip install xgboost==0.90\n",
23+
" !pip install scikit-optimize==0.9.0\n",
24+
" !pip install GPy==1.10.0\n",
25+
" !pip install GPyOpt==1.2.6\n",
26+
" !pip install xgboost==1.7.2\n",
2627
"except:\n",
2728
" pass"
2829
]
@@ -245,7 +246,7 @@
245246
" \n",
246247
" def min_obj(X):\n",
247248
" # Minimization objective is the negative acquisition function\n",
248-
" return -acquisition(X.reshape(-1, dim), X_sample, Y_sample, gpr)\n",
249+
" return -acquisition(X.reshape(-1, dim), X_sample, Y_sample, gpr).flatten()\n",
249250
" \n",
250251
" # Find the best optimum by starting from n_restart different random points.\n",
251252
" for x0 in np.random.uniform(bounds[:, 0], bounds[:, 1], size=(n_restarts, dim)):\n",
@@ -695,4 +696,4 @@
695696
},
696697
"nbformat": 4,
697698
"nbformat_minor": 2
698-
}
699+
}

0 commit comments

Comments
 (0)