Skip to main content

Logarithmically partitioned mixed-variable surrogate optimization.

Project description

LOGUSO

loguso is a Python package for mixed-variable surrogate optimization on discretized real, integer, and categorical search spaces. It also includes a categorical extension of the COCO bbob-mixint benchmark family, where categorical assignments are routed to COCO instance numbers through a stable hash.

Installation

Install the package in editable mode from the repository root:

pip install -e . --no-build-isolation

If you also want to build categorical COCO benchmarks, install COCO's Python bindings so that import cocoex works in your environment:

python -c "import cocoex"

What Is Included

  • loguso.loguso(...): the main optimizer
  • loguso.make_coco_categorical_benchmark(...): build one categorical COCO benchmark task
  • loguso.build_coco_categorical_suite(...): build a benchmark suite over selected functions and dimensions
  • loguso.CocoCategoricalSuite: lower-level categorical COCO wrapper

Minimal Example

The example below optimizes one categorical COCO function, namely the separable sphere function F1 in total dimension 24.

from loguso import loguso, make_coco_categorical_benchmark

spec = make_coco_categorical_benchmark(
    function_index=1,
    total_dimension=24,
    instances=100,
    real_levels=101,
)

result = loguso(
    exp_func=spec.exp_func,
    arg_dict=spec.arg_dict,
    opt=spec.opt,
    model="xgboost",
    uncertainty_metric="mipt",
    initial_sample_size=24,
    iterative_sample_size=8,
    parallel_tasks=8,
    max_evaluations=160,
    local_search=True,
    local_search_max_iters=20,
    local_search_ordered_radius_fraction=0.075,
    local_search_categorical_radius=1,
    log_scale_increase_rate=1.2,
    seed=0,
)

print("Best value:", result["value"])
print("Best point:", result["point"])

result["point"] is a dictionary in the original argument structure expected by the expensive function, while result["value"] stores the best objective value found.

Notes

  • Categorical COCO tasks require COCO's Python bindings at runtime.
  • The categorical benchmark family supports the public total dimensions 6, 12, 24, 48, 96, 192.
  • Supported surrogate backends are xgboost, catboost, and lightgbm.

Project details


Download files

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

Source Distribution

loguso-0.1.0.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

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

loguso-0.1.0-py3-none-any.whl (25.9 kB view details)

Uploaded Python 3

File details

Details for the file loguso-0.1.0.tar.gz.

File metadata

  • Download URL: loguso-0.1.0.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.5

File hashes

Hashes for loguso-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b420ff673b3ba227cccf512371f4abd4e4953552d799c3e06e00ee9965479a4d
MD5 a1fa73a13d473fbbb932c47891a55d4c
BLAKE2b-256 45fc6d1391fcf8cf015080a07e19c8837b0c3c2062eaf020e08604a80c679841

See more details on using hashes here.

File details

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

File metadata

  • Download URL: loguso-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.5

File hashes

Hashes for loguso-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a4a9be190370a288d9f8040d4ca79113b2151821a89e90fd6918556231c0bf38
MD5 bea69cb13642dbb86f42626a44d731e5
BLAKE2b-256 5fefc290377b6af3c67beb783cfabef695ddb736ff32bae8731e209077ac744e

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