{"id":22156615,"url":"https://github.com/pablormier/yabox","last_synced_at":"2025-04-07T11:05:00.644Z","repository":{"id":62590274,"uuid":"97233963","full_name":"pablormier/yabox","owner":"pablormier","description":"Yet another black-box optimization library for Python","archived":false,"fork":false,"pushed_at":"2022-12-06T09:07:39.000Z","size":1653,"stargazers_count":138,"open_issues_count":6,"forks_count":16,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T09:06:56.404Z","etag":null,"topics":["algorithms","black-box","black-box-optimization","data-science","differential-evolution","evolutionary-algorithms","minimization","optimization","parallel","python","python3","stochastic-algorithms"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pablormier.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-14T12:57:43.000Z","updated_at":"2025-03-24T12:20:49.000Z","dependencies_parsed_at":"2023-01-24T01:15:59.117Z","dependency_job_id":null,"html_url":"https://github.com/pablormier/yabox","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pablormier%2Fyabox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pablormier%2Fyabox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pablormier%2Fyabox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pablormier%2Fyabox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pablormier","download_url":"https://codeload.github.com/pablormier/yabox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247640462,"owners_count":20971557,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithms","black-box","black-box-optimization","data-science","differential-evolution","evolutionary-algorithms","minimization","optimization","parallel","python","python3","stochastic-algorithms"],"created_at":"2024-12-02T02:53:22.112Z","updated_at":"2025-04-07T11:05:00.626Z","avatar_url":"https://github.com/pablormier.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src='../master/docs/images/yabox.png?raw=true' width=300 /\u003e\n[![DOI](https://zenodo.org/badge/97233963.svg)](https://zenodo.org/badge/latestdoi/97233963)\n\n_Yet another black-box optimization library for Python_\n\n\n## Description\n\nYabox is a very small library for black-box (derivative free) optimization of functions that only depends on `numpy` and `matplotlib` for visualization. The library includes different stochastic algorithms for minimizing a function `f(X)`  that does not need to have an analytical form, where `X = {x1, ..., xN}`.\nThe current version of the library includes the Differential Evolution algorithm and a modified version for parallel evaluation.\n\nExample of minimization of the Ackley function (using Yabox and Differential Evolution):\n\n![Ackley Function](../master/notebooks/img/ackley.gif?raw=true)\n\n## Installation\n\nYabox is in PyPI so you can use the following command to install the latest released version:\n```bash\npip install yabox\n```\n\n## Basic usage\n\n### Pre-defined functions\nYabox includes some default benchmark functions used in black-box optimization, available in the package yabox.problems. These functions also include 2D and 3D plotting capabilities:\n\n```python\n\u003e\u003e\u003e from yabox.problems import Levy\n\u003e\u003e\u003e problem = Levy()\n\u003e\u003e\u003e problem.plot3d()\n```\n\n![Levy Function](../master/docs/images/levy.png?raw=true)\n\nA problem is just a function that can be evaluated for a given X:\n```python\n\u003e\u003e\u003e problem(np.array([1,1,1]))\n0.80668910823394901\n```\n\n\n### Optimization\n\nSimple example minimizing a function of one variable `x` using Differential Evolution, searching between -10 \u003c= x \u003c= 10:\n\n```python\n\u003e\u003e\u003e from yabox import DE\n\u003e\u003e\u003e DE(lambda x: sum(x**2), [(-10, 10)]).solve()\n(array([ 0.]), 0.0)\n```\n\nExample using Differential Evolution and showing progress (requires tqdm)\n\n![Optimization example](../master/docs/images/opt_example.gif?raw=true)\n\nYabox includes a parallel version of Differential Evolution. Import PDE instead of DE:\n\n```python\n\u003e\u003e\u003e from yabox import PDE\n\u003e\u003e\u003e PDE(lambda x: sum(x**2), [(-10, 10)]).solve()\n(array([ 0.]), 0.0)\n```\n\n\n**For more examples, check the notebooks included in the project**\n\n## About\n\nThis library is inspired in the scipy's differential evolution implementation. The main goal of Yabox is to include a larger set of stochastic black-box optimization algorithms plus many utilities, all in a small library with minimal dependencies.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpablormier%2Fyabox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpablormier%2Fyabox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpablormier%2Fyabox/lists"}