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[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).
-
property
mean
¶ The average of all values in data.
-
property
n_requested
¶
-
plot
()[source]¶ Returns a histogram of the evaluated data.
- Returns
A histogram of the evaluated data.
- Return type
-
property
std
¶ 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) –