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:

from __future__ import annotations

from hpo_benchmarks import HPOBench

import optuna


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


def objective(trial: optuna.Trial) -> list[float]:
    params = {}
    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)]

    results = bench(params)
    return [results[name] for name in bench.metric_names]


study = optuna.create_study(direction=[bench.directions[name] for name in bench.metric_names])
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.2.0-py3-none-any.whl (36.5 MB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for simple_hpo_bench-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f76495fa70fa96c234c4bc3ad18c8e8283bec4c2f66f08ef59071b1d286d720
MD5 c847f2003f712a309bf91ed9d9e49fd5
BLAKE2b-256 ece3799b57c24ae86dc4c79468fde3e23e3d4133f2b070e1eadf780421c26fbe

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