adaptive.BaseLearner¶
-
class
adaptive.learner.BaseLearner[source]¶ Bases:
objectBase class for algorithms for learning a function ‘f: X → Y’.
-
function¶ The function to learn.
- Type
callable: X → Y
-
data¶ function evaluated at certain points. The values can be ‘None’, which indicates that the point will be evaluated, but that we do not have the result yet.
- Type
dict: X → Y
-
npoints¶ The number of evaluated points that have been added to the learner. Subclasses do not have to implement this attribute.
- Type
int, optional
-
pending_points¶ Points that have been requested but have not been evaluated yet. Subclasses do not have to implement this attribute.
- Type
set, optional
Notes
Subclasses may define a
plotmethod that takes no parameters and returns a holoviews plot.-
copy_from(other)[source]¶ Copy over the data from another learner.
- Parameters
other (BaseLearner object) – The learner from which the data is copied.
-
loss(real=True)[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).
-
tell(x, y)[source]¶ Tell the learner about a single value.
- Parameters
x (A value from the function domain) –
y (A value from the function image) –
-