Skip to content
📈 Adaptive: parallel active learning of mathematical functions
Python Jupyter Notebook
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
adaptive simplify _table_row in Dec 19, 2019
benchmarks run pre-commit run --all Dec 11, 2019
docs fix syntax highlighting and syntax error Dec 13, 2019
.gitattributes fix .gitattributes Jun 12, 2018
.gitignore MNT: add vscode config directory to .gitignore (#255) Jan 8, 2020
.mailmap add mailmap Aug 31, 2018
.pre-commit-config.yaml use settings from tox.ini in .pre-commit-config.yaml Dec 16, 2019 add @caenrigen to authors file Dec 18, 2019
LICENSE 2019 → 2020 in LICENSE Jan 22, 2020 add LICENSE file to source distributions Feb 24, 2018
README.rst add instructions for installing labextensions for Jupyterlab (#257) Jan 15, 2020 change urls from GitLab to GitHub Jan 21, 2019
azure-pipelines.yml test against windows-latest in CI Dec 17, 2019
environment.yml ensure atomic writes when saving a file Jun 21, 2019
example-notebook.ipynb fix all flake8 issues and run pre-commit filters May 8, 2019
pyproject.toml add pyproject.toml Dec 16, 2019
readthedocs.yml only build the html format on RTD Oct 18, 2018 add flaky to tests that sometimes fail Dec 17, 2019


logo adaptive

PyPI Conda Downloads Pipeline status DOI Binder Gitter Documentation Coverage GitHub

Adaptive: parallel active learning of mathematical functions.

adaptive is an open-source Python library designed to make adaptive parallel function evaluation simple. With adaptive you just supply a function with its bounds, and it will be evaluated at the “best” points in parameter space. With just a few lines of code you can evaluate functions on a computing cluster, live-plot the data as it returns, and fine-tune the adaptive sampling algorithm.

Run the adaptive example notebook live on Binder to see examples of how to use adaptive or visit the tutorial on Read the Docs.

WARNING: adaptive is still in a beta development stage

Implemented algorithms

The core concept in adaptive is that of a learner. A learner samples a function at the best places in its parameter space to get maximum “information” about the function. As it evaluates the function at more and more points in the parameter space, it gets a better idea of where the best places are to sample next.

Of course, what qualifies as the “best places” will depend on your application domain! adaptive makes some reasonable default choices, but the details of the adaptive sampling are completely customizable.

The following learners are implemented:

  • Learner1D, for 1D functions f: ℝ → ℝ^N,
  • Learner2D, for 2D functions f: ℝ^2 → ℝ^N,
  • LearnerND, for ND functions f: ℝ^N → ℝ^M,
  • AverageLearner, For stochastic functions where you want to average the result over many evaluations,
  • IntegratorLearner, for when you want to intergrate a 1D function f: ℝ → ℝ,
  • BalancingLearner, for when you want to run several learners at once, selecting the “best” one each time you get more points.

In addition to the learners, adaptive also provides primitives for running the sampling across several cores and even several machines, with built-in support for concurrent.futures, ipyparallel and distributed.



adaptive works with Python 3.6 and higher on Linux, Windows, or Mac, and provides optional extensions for working with the Jupyter/IPython Notebook.

The recommended way to install adaptive is using conda:

conda install -c conda-forge adaptive

adaptive is also available on PyPI:

pip install adaptive[notebook]

The [notebook] above will also install the optional dependencies for running adaptive inside a Jupyter notebook.

To use Adaptive in Jupyterlab, you need to install the following labextensions.

jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install @pyviz/jupyterlab_pyviz


Clone the repository and run develop to add a link to the cloned repo into your Python path:

git clone
cd adaptive
python3 develop

We highly recommend using a Conda environment or a virtualenv to manage the versions of your installed packages while working on adaptive.

In order to not pollute the history with the output of the notebooks, please setup the git filter by executing


in the repository.

We implement several other checks in order to maintain a consistent code style. We do this using pre-commit, execute

pre-commit install

in the repository.


If you used Adaptive in a scientific work, please cite it as follows.

  doi = {10.5281/zenodo.1182437},
  author = {Bas Nijholt and Joseph Weston and Jorn Hoofwijk and Anton Akhmerov},
  title = {\textit{Adaptive}: parallel active learning of mathematical functions},
  publisher = {Zenodo},
  year = {2019}


We would like to give credits to the following people:

  • Pedro Gonnet for his implementation of CQUAD, “Algorithm 4” as described in “Increasing the Reliability of Adaptive Quadrature Using Explicit Interpolants”, P. Gonnet, ACM Transactions on Mathematical Software, 37 (3), art. no. 26, 2010.
  • Pauli Virtanen for his AdaptiveTriSampling script (no longer available online since SciPy Central went down) which served as inspiration for the ~adaptive.Learner2D.

For general discussion, we have a Gitter chat channel. If you find any bugs or have any feature suggestions please file a GitHub issue or submit a pull request.

You can’t perform that action at this time.