# adaptiveÂ¶

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.

## 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: â„ť â†’ â„ť`

.

Meta-learners (to be used with other learners):

`BalancingLearner`

, for when you want to run several learners at once, selecting the â€śbestâ€ť one each time you get more points,`DataSaver`

, for when your function doesnâ€™t just return a scalar or a vector.

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.

## ExamplesÂ¶

Here are some examples of how Adaptive samples vs. homogeneous sampling. Click
on the *Play* button or move the sliders.

```
import itertools
import adaptive
from adaptive.learner.learner1D import uniform_loss, default_loss
import holoviews as hv
import numpy as np
adaptive.notebook_extension()
%output holomap='scrubber'
```