Skip to content

Commit

Permalink
Fix errors in Bayesian Optimization Colab notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
krasserm committed Jan 26, 2023
1 parent 22c0c6c commit a3b2583
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions bayesian-optimization/bayesian_optimization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
"try:\n",
" # Check if notebook is running in Google Colab\n",
" import google.colab\n",
" !pip install matplotlib==3.1.3\n",
" # Get additional files from Github\n",
" !wget https://raw.githubusercontent.com/krasserm/bayesian-machine-learning/dev/bayesian-optimization/bayesian_optimization_util.py\n",
" # Install additional dependencies\n",
" !pip install scikit-optimize==0.5.2\n",
" !pip install GPy==1.9.8\n",
" !pip install GPyOpt==1.2.1\n",
" !pip install xgboost==0.90\n",
" !pip install scikit-optimize==0.9.0\n",
" !pip install GPy==1.10.0\n",
" !pip install GPyOpt==1.2.6\n",
" !pip install xgboost==1.7.2\n",
"except:\n",
" pass"
]
Expand Down Expand Up @@ -245,7 +246,7 @@
" \n",
" def min_obj(X):\n",
" # Minimization objective is the negative acquisition function\n",
" return -acquisition(X.reshape(-1, dim), X_sample, Y_sample, gpr)\n",
" return -acquisition(X.reshape(-1, dim), X_sample, Y_sample, gpr).flatten()\n",
" \n",
" # Find the best optimum by starting from n_restart different random points.\n",
" for x0 in np.random.uniform(bounds[:, 0], bounds[:, 1], size=(n_restarts, dim)):\n",
Expand Down Expand Up @@ -695,4 +696,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}

0 comments on commit a3b2583

Please sign in to comment.