# How to run PrBO

## Installation

PrBO requires python3. To setup PrBO, install python3, pip, and then install PrBO's dependencies with:
pip3 install -r requirements.txt

## Running PrBO

The code for the benchmarks used in the paper is provided in the 'benchmarks/' directory. Instructions to run each benchmark are detailed below. By default, PrBO will use the strong prior files in the "prior_data" directory to estimate priors for each benchcmark using a univariate gausssian kde. The strong prior files provided contain the best 10D out of 10,000,000D random samples, where d is the number of input parameters of the benchmark. We also provide a weaker prior data for PrBO, with 1000D random samples. The default behavior for PrBO can be changed using the json schema defined in the [benchmark]_scenario.json file. To use the weaker prior, replace the filename in "prior_estimation_file" and add a '"prior_estimation_quantile": 0.001', line to the json file. PrBO will automatically compute the best 10D points for the prior, out of the 1000D random samples. The full list of hyperparameters that can be changed is found in the "scripts/schema.json" file.

### Running the Branin benchmark

The code for running the Branin benchmark used in the paper is provided in the benchmarks/ directory. To run Branin, use:

python3 benchmarks/branin/branin.py

The benchmark should be executed from the PrBO root folder. The optimization result will be saved in the "branin_output_samples.csv" file.

### Running the Profet benchmarks

The Profet benchmarks require the Profet data and code. Move to the benchmarks/profet directory and clone the Profet branch from emukit:

cd benchmarks/profet
git clone -b profet https://github.com/aaronkl/emukit.git

Then, download and extract the data from http://www.automl.org/wp-content/uploads/2019/05/profet_data.tar.gz:

wget http://www.automl.org/wp-content/uploads/2019/05/profet_data.tar.gz
tar -xvzf profet_data.tar.gz
cd ../../

The profet_data folder that was downloaded should be stored in the benchmarks/profet/ directory. Finally, run one of the benchmarks with one of:

python3 benchmarks/profet/svm.py
python3 benchmarks/profet/fcnet.py
python3 benchmarks/profet/xgboost.py

All benchmarks should be executed from the PrBO root folder. The optimization result will be saved in the "[benchmark]_42_output_samples.csv" file.

