skoptimize


Nameskoptimize JSON
Version 0.9.0 PyPI version JSON
download
home_pagehttps://scikit-optimize.github.io/
SummarySequential model-based optimization toolbox.
upload_time2024-08-09 19:42:36
maintainerNone
docs_urlNone
authorThe scikit-optimize contributors
requires_pythonNone
licenseBSD 3-clause
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
|Logo|

|pypi| |conda| |Travis Status| |CircleCI Status| |binder| |gitter| |Zenodo DOI|

Scikit-Optimize
===============

Scikit-Optimize, or ``skopt``, is a simple and efficient library to
minimize (very) expensive and noisy black-box functions. It implements
several methods for sequential model-based optimization. ``skopt`` aims
to be accessible and easy to use in many contexts.

The library is built on top of NumPy, SciPy and Scikit-Learn.

We do not perform gradient-based optimization. For gradient-based
optimization algorithms look at
``scipy.optimize``
`here <http://docs.scipy.org/doc/scipy/reference/optimize.html>`_.

.. figure:: https://github.com/scikit-optimize/scikit-optimize/blob/master/media/bo-objective.png
   :alt: Approximated objective

Approximated objective function after 50 iterations of ``gp_minimize``.
Plot made using ``skopt.plots.plot_objective``.

Important links
---------------

-  Static documentation - `Static
   documentation <https://scikit-optimize.github.io/>`__
-  Example notebooks - can be found in examples_.
-  Issue tracker -
   https://github.com/scikit-optimize/scikit-optimize/issues
-  Releases - https://pypi.python.org/pypi/scikit-optimize

Install
-------

scikit-optimize requires

* Python >= 3.6
* NumPy (>= 1.13.3)
* SciPy (>= 0.19.1)
* joblib (>= 0.11)
* scikit-learn >= 0.20
* matplotlib >= 2.0.0

You can install the latest release with:
::

    pip install scikit-optimize

This installs an essential version of scikit-optimize. To install scikit-optimize
with plotting functionality, you can instead do:
::

    pip install 'scikit-optimize[plots]'

This will install matplotlib along with scikit-optimize.

In addition there is a `conda-forge <https://conda-forge.org/>`_ package
of scikit-optimize:
::

    conda install -c conda-forge scikit-optimize

Using conda-forge is probably the easiest way to install scikit-optimize on
Windows.


Getting started
---------------

Find the minimum of the noisy function ``f(x)`` over the range
``-2 < x < 2`` with ``skopt``:

.. code:: python

    import numpy as np
    from skopt import gp_minimize

    def f(x):
        return (np.sin(5 * x[0]) * (1 - np.tanh(x[0] ** 2)) +
                np.random.randn() * 0.1)

    res = gp_minimize(f, [(-2.0, 2.0)])


For more control over the optimization loop you can use the ``skopt.Optimizer``
class:

.. code:: python

    from skopt import Optimizer

    opt = Optimizer([(-2.0, 2.0)])

    for i in range(20):
        suggested = opt.ask()
        y = f(suggested)
        opt.tell(suggested, y)
        print('iteration:', i, suggested, y)


Read our `introduction to bayesian
optimization <https://scikit-optimize.github.io/stable/auto_examples/bayesian-optimization.html>`__
and the other examples_.


Development
-----------

The library is still experimental and under heavy development. Checkout
the `next
milestone <https://github.com/scikit-optimize/scikit-optimize/milestones>`__
for the plans for the next release or look at some `easy
issues <https://github.com/scikit-optimize/scikit-optimize/issues?q=is%3Aissue+is%3Aopen+label%3AEasy>`__
to get started contributing.

The development version can be installed through:

::

    git clone https://github.com/scikit-optimize/scikit-optimize.git
    cd scikit-optimize
    pip install -e.

Run all tests by executing ``pytest`` in the top level directory.

To only run the subset of tests with short run time, you can use ``pytest -m 'fast_test'`` (``pytest -m 'slow_test'`` is also possible). To exclude all slow running tests try ``pytest -m 'not slow_test'``.

This is implemented using pytest `attributes <https://docs.pytest.org/en/latest/mark.html>`__. If a tests runs longer than 1 second, it is marked as slow, else as fast.

All contributors are welcome!


Making a Release
~~~~~~~~~~~~~~~~

The release procedure is almost completely automated. By tagging a new release
travis will build all required packages and push them to PyPI. To make a release
create a new issue and work through the following checklist:

* update the version tag in ``__init__.py``
* update the version tag mentioned in the README
* check if the dependencies in ``setup.py`` are valid or need unpinning
* check that the ``doc/whats_new/v0.X.rst`` is up to date
* did the last build of master succeed?
* create a `new release <https://github.com/scikit-optimize/scikit-optimize/releases>`__
* ping `conda-forge <https://github.com/conda-forge/scikit-optimize-feedstock>`__

Before making a release we usually create a release candidate. If the next
release is v0.X then the release candidate should be tagged v0.Xrc1 in
``__init__.py``. Mark a release candidate as a "pre-release"
on GitHub when you tag it.


Commercial support
------------------

Feel free to `get in touch <mailto:tim@wildtreetech.com>`_ if you need commercial
support or would like to sponsor development. Resources go towards paying
for additional work by seasoned engineers and researchers.


Made possible by
----------------

The scikit-optimize project was made possible with the support of

.. image:: https://avatars1.githubusercontent.com/u/18165687?v=4&s=128
   :alt: Wild Tree Tech
   :target: http://wildtreetech.com

.. image:: https://i.imgur.com/lgxboT5.jpg
    :alt: NYU Center for Data Science
    :target: https://cds.nyu.edu/

.. image:: https://i.imgur.com/V1VSIvj.jpg
    :alt: NSF
    :target: https://www.nsf.gov

.. image:: https://i.imgur.com/3enQ6S8.jpg
    :alt: Northrop Grumman
    :target: http://www.northropgrumman.com/Pages/default.aspx

If your employer allows you to work on scikit-optimize during the day and would like
recognition, feel free to add them to the "Made possible by" list.


.. |pypi| image:: https://img.shields.io/pypi/v/scikit-optimize.svg
   :target: https://pypi.python.org/pypi/scikit-optimize
.. |conda| image:: https://anaconda.org/conda-forge/scikit-optimize/badges/version.svg
   :target: https://anaconda.org/conda-forge/scikit-optimize
.. |Travis Status| image:: https://travis-ci.org/scikit-optimize/scikit-optimize.svg?branch=master
   :target: https://travis-ci.org/scikit-optimize/scikit-optimize
.. |CircleCI Status| image:: https://circleci.com/gh/scikit-optimize/scikit-optimize/tree/master.svg?style=shield&circle-token=:circle-token
   :target: https://circleci.com/gh/scikit-optimize/scikit-optimize
.. |Logo| image:: https://avatars2.githubusercontent.com/u/18578550?v=4&s=80
.. |binder| image:: https://mybinder.org/badge.svg
   :target: https://mybinder.org/v2/gh/scikit-optimize/scikit-optimize/master?filepath=examples
.. |gitter| image:: https://badges.gitter.im/scikit-optimize/scikit-optimize.svg
   :target: https://gitter.im/scikit-optimize/Lobby
.. |Zenodo DOI| image:: https://zenodo.org/badge/54340642.svg
   :target: https://zenodo.org/badge/latestdoi/54340642
.. _examples: https://scikit-optimize.github.io/stable/auto_examples/index.html

            

Raw data

            {
    "_id": null,
    "home_page": "https://scikit-optimize.github.io/",
    "name": "skoptimize",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "The scikit-optimize contributors",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/e8/f8/d0b86bb69fd07952c47b1011fc0011b3077d027f3c4e45c5e13db040d45a/skoptimize-0.9.0.tar.gz",
    "platform": null,
    "description": "\r\n|Logo|\r\n\r\n|pypi| |conda| |Travis Status| |CircleCI Status| |binder| |gitter| |Zenodo DOI|\r\n\r\nScikit-Optimize\r\n===============\r\n\r\nScikit-Optimize, or ``skopt``, is a simple and efficient library to\r\nminimize (very) expensive and noisy black-box functions. It implements\r\nseveral methods for sequential model-based optimization. ``skopt`` aims\r\nto be accessible and easy to use in many contexts.\r\n\r\nThe library is built on top of NumPy, SciPy and Scikit-Learn.\r\n\r\nWe do not perform gradient-based optimization. For gradient-based\r\noptimization algorithms look at\r\n``scipy.optimize``\r\n`here <http://docs.scipy.org/doc/scipy/reference/optimize.html>`_.\r\n\r\n.. figure:: https://github.com/scikit-optimize/scikit-optimize/blob/master/media/bo-objective.png\r\n   :alt: Approximated objective\r\n\r\nApproximated objective function after 50 iterations of ``gp_minimize``.\r\nPlot made using ``skopt.plots.plot_objective``.\r\n\r\nImportant links\r\n---------------\r\n\r\n-  Static documentation - `Static\r\n   documentation <https://scikit-optimize.github.io/>`__\r\n-  Example notebooks - can be found in examples_.\r\n-  Issue tracker -\r\n   https://github.com/scikit-optimize/scikit-optimize/issues\r\n-  Releases - https://pypi.python.org/pypi/scikit-optimize\r\n\r\nInstall\r\n-------\r\n\r\nscikit-optimize requires\r\n\r\n* Python >= 3.6\r\n* NumPy (>= 1.13.3)\r\n* SciPy (>= 0.19.1)\r\n* joblib (>= 0.11)\r\n* scikit-learn >= 0.20\r\n* matplotlib >= 2.0.0\r\n\r\nYou can install the latest release with:\r\n::\r\n\r\n    pip install scikit-optimize\r\n\r\nThis installs an essential version of scikit-optimize. To install scikit-optimize\r\nwith plotting functionality, you can instead do:\r\n::\r\n\r\n    pip install 'scikit-optimize[plots]'\r\n\r\nThis will install matplotlib along with scikit-optimize.\r\n\r\nIn addition there is a `conda-forge <https://conda-forge.org/>`_ package\r\nof scikit-optimize:\r\n::\r\n\r\n    conda install -c conda-forge scikit-optimize\r\n\r\nUsing conda-forge is probably the easiest way to install scikit-optimize on\r\nWindows.\r\n\r\n\r\nGetting started\r\n---------------\r\n\r\nFind the minimum of the noisy function ``f(x)`` over the range\r\n``-2 < x < 2`` with ``skopt``:\r\n\r\n.. code:: python\r\n\r\n    import numpy as np\r\n    from skopt import gp_minimize\r\n\r\n    def f(x):\r\n        return (np.sin(5 * x[0]) * (1 - np.tanh(x[0] ** 2)) +\r\n                np.random.randn() * 0.1)\r\n\r\n    res = gp_minimize(f, [(-2.0, 2.0)])\r\n\r\n\r\nFor more control over the optimization loop you can use the ``skopt.Optimizer``\r\nclass:\r\n\r\n.. code:: python\r\n\r\n    from skopt import Optimizer\r\n\r\n    opt = Optimizer([(-2.0, 2.0)])\r\n\r\n    for i in range(20):\r\n        suggested = opt.ask()\r\n        y = f(suggested)\r\n        opt.tell(suggested, y)\r\n        print('iteration:', i, suggested, y)\r\n\r\n\r\nRead our `introduction to bayesian\r\noptimization <https://scikit-optimize.github.io/stable/auto_examples/bayesian-optimization.html>`__\r\nand the other examples_.\r\n\r\n\r\nDevelopment\r\n-----------\r\n\r\nThe library is still experimental and under heavy development. Checkout\r\nthe `next\r\nmilestone <https://github.com/scikit-optimize/scikit-optimize/milestones>`__\r\nfor the plans for the next release or look at some `easy\r\nissues <https://github.com/scikit-optimize/scikit-optimize/issues?q=is%3Aissue+is%3Aopen+label%3AEasy>`__\r\nto get started contributing.\r\n\r\nThe development version can be installed through:\r\n\r\n::\r\n\r\n    git clone https://github.com/scikit-optimize/scikit-optimize.git\r\n    cd scikit-optimize\r\n    pip install -e.\r\n\r\nRun all tests by executing ``pytest`` in the top level directory.\r\n\r\nTo only run the subset of tests with short run time, you can use ``pytest -m 'fast_test'`` (``pytest -m 'slow_test'`` is also possible). To exclude all slow running tests try ``pytest -m 'not slow_test'``.\r\n\r\nThis is implemented using pytest `attributes <https://docs.pytest.org/en/latest/mark.html>`__. If a tests runs longer than 1 second, it is marked as slow, else as fast.\r\n\r\nAll contributors are welcome!\r\n\r\n\r\nMaking a Release\r\n~~~~~~~~~~~~~~~~\r\n\r\nThe release procedure is almost completely automated. By tagging a new release\r\ntravis will build all required packages and push them to PyPI. To make a release\r\ncreate a new issue and work through the following checklist:\r\n\r\n* update the version tag in ``__init__.py``\r\n* update the version tag mentioned in the README\r\n* check if the dependencies in ``setup.py`` are valid or need unpinning\r\n* check that the ``doc/whats_new/v0.X.rst`` is up to date\r\n* did the last build of master succeed?\r\n* create a `new release <https://github.com/scikit-optimize/scikit-optimize/releases>`__\r\n* ping `conda-forge <https://github.com/conda-forge/scikit-optimize-feedstock>`__\r\n\r\nBefore making a release we usually create a release candidate. If the next\r\nrelease is v0.X then the release candidate should be tagged v0.Xrc1 in\r\n``__init__.py``. Mark a release candidate as a \"pre-release\"\r\non GitHub when you tag it.\r\n\r\n\r\nCommercial support\r\n------------------\r\n\r\nFeel free to `get in touch <mailto:tim@wildtreetech.com>`_ if you need commercial\r\nsupport or would like to sponsor development. Resources go towards paying\r\nfor additional work by seasoned engineers and researchers.\r\n\r\n\r\nMade possible by\r\n----------------\r\n\r\nThe scikit-optimize project was made possible with the support of\r\n\r\n.. image:: https://avatars1.githubusercontent.com/u/18165687?v=4&s=128\r\n   :alt: Wild Tree Tech\r\n   :target: http://wildtreetech.com\r\n\r\n.. image:: https://i.imgur.com/lgxboT5.jpg\r\n    :alt: NYU Center for Data Science\r\n    :target: https://cds.nyu.edu/\r\n\r\n.. image:: https://i.imgur.com/V1VSIvj.jpg\r\n    :alt: NSF\r\n    :target: https://www.nsf.gov\r\n\r\n.. image:: https://i.imgur.com/3enQ6S8.jpg\r\n    :alt: Northrop Grumman\r\n    :target: http://www.northropgrumman.com/Pages/default.aspx\r\n\r\nIf your employer allows you to work on scikit-optimize during the day and would like\r\nrecognition, feel free to add them to the \"Made possible by\" list.\r\n\r\n\r\n.. |pypi| image:: https://img.shields.io/pypi/v/scikit-optimize.svg\r\n   :target: https://pypi.python.org/pypi/scikit-optimize\r\n.. |conda| image:: https://anaconda.org/conda-forge/scikit-optimize/badges/version.svg\r\n   :target: https://anaconda.org/conda-forge/scikit-optimize\r\n.. |Travis Status| image:: https://travis-ci.org/scikit-optimize/scikit-optimize.svg?branch=master\r\n   :target: https://travis-ci.org/scikit-optimize/scikit-optimize\r\n.. |CircleCI Status| image:: https://circleci.com/gh/scikit-optimize/scikit-optimize/tree/master.svg?style=shield&circle-token=:circle-token\r\n   :target: https://circleci.com/gh/scikit-optimize/scikit-optimize\r\n.. |Logo| image:: https://avatars2.githubusercontent.com/u/18578550?v=4&s=80\r\n.. |binder| image:: https://mybinder.org/badge.svg\r\n   :target: https://mybinder.org/v2/gh/scikit-optimize/scikit-optimize/master?filepath=examples\r\n.. |gitter| image:: https://badges.gitter.im/scikit-optimize/scikit-optimize.svg\r\n   :target: https://gitter.im/scikit-optimize/Lobby\r\n.. |Zenodo DOI| image:: https://zenodo.org/badge/54340642.svg\r\n   :target: https://zenodo.org/badge/latestdoi/54340642\r\n.. _examples: https://scikit-optimize.github.io/stable/auto_examples/index.html\r\n",
    "bugtrack_url": null,
    "license": "BSD 3-clause",
    "summary": "Sequential model-based optimization toolbox.",
    "version": "0.9.0",
    "project_urls": {
        "Homepage": "https://scikit-optimize.github.io/"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "22333ff1df8c2e1198045369fbc60941b46b9ea0264b9b0675a7e92b0812e1a8",
                "md5": "c7528d2d84cce47f3be8f4ea86bff6b4",
                "sha256": "01a5c217a31b0870255fc46d5568f71ac7cc04ef3b4beb29870ce377e9948f93"
            },
            "downloads": -1,
            "filename": "skoptimize-0.9.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c7528d2d84cce47f3be8f4ea86bff6b4",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 100914,
            "upload_time": "2024-08-09T19:42:34",
            "upload_time_iso_8601": "2024-08-09T19:42:34.588663Z",
            "url": "https://files.pythonhosted.org/packages/22/33/3ff1df8c2e1198045369fbc60941b46b9ea0264b9b0675a7e92b0812e1a8/skoptimize-0.9.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e8f8d0b86bb69fd07952c47b1011fc0011b3077d027f3c4e45c5e13db040d45a",
                "md5": "c524544e51f02299f32d22362a5bb956",
                "sha256": "d5d3f5bc284b4441bf0f672e07a613402abda1c3510466fd604a246411519601"
            },
            "downloads": -1,
            "filename": "skoptimize-0.9.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c524544e51f02299f32d22362a5bb956",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 282662,
            "upload_time": "2024-08-09T19:42:36",
            "upload_time_iso_8601": "2024-08-09T19:42:36.943348Z",
            "url": "https://files.pythonhosted.org/packages/e8/f8/d0b86bb69fd07952c47b1011fc0011b3077d027f3c4e45c5e13db040d45a/skoptimize-0.9.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-09 19:42:36",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "skoptimize"
}
        
Elapsed time: 0.31055s