- class adaptive.learner.BaseLearner(*args, **kwargs)#
Base class for algorithms for learning a function ‘f: X → Y’.
The function to learn. A subclass of BaseLearner might modify the user’s supplied function.
callable: X → Y
function evaluated at certain points.
dict: X → Y
Subclasses may define a
plotmethod that takes no parameters and returns a holoviews plot.
- abstract ask(n, tell_pending=True)#
Choose the next ‘n’ points to evaluate.
Copy over the data from another learner.
other (BaseLearner object) – The learner from which the data is copied.
- load(fname, compress=True)#
Load the data of a learner from a pickle file.
- abstract loss(real=True)#
Return the loss for the current state of the learner.
real (bool, default: True) – If False, return the “expected” loss, i.e. the loss including the as-yet unevaluated points (possibly by interpolation).
- abstract new()#
Return a new learner with the same function and parameters.
- abstract remove_unfinished()#
Remove uncomputed data from the learner.
- save(fname, compress=True)#
Save the data of the learner into a pickle file.
- tell(x, y)#
Tell the learner about a single value.
x (A value from the function domain) –
y (A value from the function image) –
- tell_many(xs, ys)#
Tell the learner about some values.
xs (Iterable of values from the function domain) –
ys (Iterable of values from the function image) –
- abstract tell_pending(x)#
Tell the learner that ‘x’ has been requested such that it’s not suggested again.