Metadata-Version: 2.4
Name: loguso
Version: 0.1.0
Summary: Logarithmically partitioned mixed-variable surrogate optimization.
Author: S. Stevanovic, D. Stevanovic
License-Expression: MIT
Project-URL: Homepage, https://github.com/dragance106/loguso
Project-URL: Repository, https://github.com/dragance106/loguso
Project-URL: Issues, https://github.com/dragance106/loguso/issues
Keywords: mixed-variable optimization,surrogate optimization,bayesian optimization,categorical optimization,coco benchmarks
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24
Requires-Dist: pandas>=2.0
Requires-Dist: scikit-learn>=1.3
Requires-Dist: xgboost>=2.0
Requires-Dist: catboost>=1.2
Requires-Dist: lightgbm>=4.0
Dynamic: license-file

# 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:

```bash
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:

```bash
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`.

```python
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`.
