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-1.0.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-1.0.0-py3-none-any.whl (25.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: loguso-1.0.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-1.0.0.tar.gz
Algorithm Hash digest
SHA256 701dcfd112ddddc4302674da6eee809b06377121293122338fae3acee26ffcf0
MD5 d706cdb51a12f3b89ccd99ca1f4193b5
BLAKE2b-256 ea607371dba2c637fe469c952f4d7168fc373f17074013d5d6fc4196d5d4ab41

See more details on using hashes here.

File details

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

File metadata

  • Download URL: loguso-1.0.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-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0472eaa39e4ca8fd35728bbfb521f64de2fce9499019932a8111e26ceaf58941
MD5 d0fa1ca5aae05086c443837526c75d0b
BLAKE2b-256 307d4dd61786439cc68612f14a33e9a81cf2a451d1734824cff5e16ee0cf75a9

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