adaptive.AverageLearner
- class adaptive.AverageLearner(*args, **kwargs)[source]
Bases:
adaptive.learner.base_learner.BaseLearner
A naive implementation of adaptive computing of averages.
The learned function must depend on an integer input variable that represents the source of randomness.
- Parameters
- ask(n: int, tell_pending: bool = True) tuple[list[int], list[typing.Union[float, numpy.float64]]] [source]
Choose the next ‘n’ points to evaluate.
- loss(real: bool = True, *, n=None) Union[float, numpy.float64] [source]
Return the loss for the current state of the learner.
- Parameters
real (bool, default: True) – If False, return the “expected” loss, i.e. the loss including the as-yet unevaluated points (possibly by interpolation).
- plot()[source]
Returns a histogram of the evaluated data.
- Returns
A histogram of the evaluated data.
- Return type
- property std: Union[float, numpy.float64]
The corrected sample standard deviation of the values in data.
- tell(n: int, value: Union[float, numpy.float64, int, numpy.int64]) None [source]
Tell the learner about a single value.
- Parameters
x (A value from the function domain) –
y (A value from the function image) –