Skip to main content

Simple hyperparameter optimization benchmark datasets

Project description

Simple HPO Benchmark Datasets

Python

This repository provides a set of simple single-objective HPO benchmark datasets:

Installation & Requirements

The requirements of this repository are:

  • Python 3.8 or later
  • NumPy

You can simply install the package via:

$ pip install simple-hpo-bench

Examples

Examples are available at examples/.

For example, HPOBench can be optimized by Optuna as follows:

import optuna

from hpo_benchmarks import HPOBench


# Instatiate the benchmark function.
bench = HPOBench(dataset_name="australian")


def objective(trial: optuna.Trial) -> float:
    params = {}
    # search_space is a dict that takes a parameter name as a key and the corresponding parameter's choices as a value.
    for param_name, choices in bench.search_space.items():
        params[param_name] = choices[trial.suggest_int(f"{param_name}_index", low=0, high=len(choices) - 1)]

    return bench(params)


study = optuna.create_study(direction=bench.direction)
study.optimize(objective, n_trials=30)

For benchmark functions, the argument for these classes is only dim, which determines the dimension of the function.

For tabular benchmarks (HPOLib, HPOBench, and NASBench201), the arguments are:

  • dataset_name: one of the dataset names of the benchmark dataset of interest, and
  • seed: the random seed for the benchmark dataset.

The available dataset names for each benchmark dataset are as follows:

Benchmark Dataset Available Dataset Names
HPOLib naval_propulsion, parkinsons_telemonitoring, protein_structure, slice_localization
HPOBench australian, blood_transfusion, car, credit_g, kc1, phoneme, segment, vehicle
NASBench201 cifar10, cifar100, imagenet

Search Space

In this section, bench is an instantiated benchmark.

The search space of the benchmark functions are [bench.param_range[0], bench.param_range[1]]^bench.dim.

The search space of HPOLib, HPOBench, and NASBench201 is defined in bench.search_space. bench.search_space is a dict that takes param_name as a key and the corresponding possible choices as a value. bench.param_types defines the types of each parameter. int is for an integer parameter, str is for a categorical parameter, and float is for a non-integer numerical parameter.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simple_hpo_bench-0.1.0-py3-none-any.whl (36.5 MB view details)

Uploaded Python 3

File details

Details for the file simple_hpo_bench-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_hpo_bench-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac697a92b468965877e178a11832ba4ca9a9646380237230235dec2e39ef9f67
MD5 45bc9a81ef0aeb83af66d4db2fc02a88
BLAKE2b-256 a368663867fa8cd44a83ceed961872345bf9b48ad09036ed1abb273211432995

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page