Welcome to OptunaHub's documentation!
=====================================
`OptunaHub `__ is a registry of third-party packages designed for `Optuna `__.
It allows users to share and discover Optuna packages that are not included in the official Optuna distribution.
The `optunahub `__ library provides Python APIs to load and use packages from the OptunaHub registry.
Please check out `the OptunaHub tutorial <./tutorials/index.html>`__ as well.
**If you are interested in registering your own features in OptunaHub**, please visit `the optunahub-registry repository `__ and submit a pull request there. More details are available in `the optunahub-registry tutorial `__.
Usage
=====
Install the `optunahub`_ package.
.. code-block:: shell
pip install optunahub
Load the package you want from the OptunaHub registry. In the next example code, you will load the ``AutoSampler`` from the `samplers/auto_sampler `__ package.
The details for ``AutoSampler`` can be found in `this article `__.
.. code-block:: python
import optuna
import optunahub
def objective(trial: optuna.Trial) -> float:
x = trial.suggest_float("x", -5, 5)
y = trial.suggest_float("y", -5, 5)
return x**2 + y**2
mod = optunahub.load_module("samplers/auto_sampler")
study = optuna.create_study(sampler=mod.AutoSampler())
study.optimize(objective, n_trials=10)
print(study.best_trial.value, study.best_trial.params)
Now that you've successfully loaded a package from the OptunaHub registry, you can start using `optunahub`_ in your optimization!
Get ready to explore the most suitable packages for your problems in the `OptunaHub registry `_.
.. toctree::
:maxdepth: 2
:caption: Contents:
reference
tutorials/index
faq