Skip to content
Snippets Groups Projects
Commit 7ea91530 authored by Bas Nijholt's avatar Bas Nijholt
Browse files

BaseLearner: create 'tell_pending' which deprecates 'tell(x, None)'

parent 899482df
Branches
No related tags found
No related merge requests found
This commit is part of merge request !107. Comments created here will be created in the context of that merge request.
...@@ -44,6 +44,12 @@ class BaseLearner(metaclass=abc.ABCMeta): ...@@ -44,6 +44,12 @@ class BaseLearner(metaclass=abc.ABCMeta):
for x, y in zip(xs, ys): for x, y in zip(xs, ys):
self.tell(x, y) self.tell(x, y)
@abc.abstractmethod
def tell_pending(self, x):
"""Tell the learner that 'x' has been requested such
that it's not suggested again."""
pass
@abc.abstractmethod @abc.abstractmethod
def remove_unfinished(self): def remove_unfinished(self):
"""Remove uncomputed data from the learner.""" """Remove uncomputed data from the learner."""
...@@ -62,14 +68,14 @@ class BaseLearner(metaclass=abc.ABCMeta): ...@@ -62,14 +68,14 @@ class BaseLearner(metaclass=abc.ABCMeta):
""" """
@abc.abstractmethod @abc.abstractmethod
def ask(self, n, add_data=True): def ask(self, n, tell_pending=True):
"""Choose the next 'n' points to evaluate. """Choose the next 'n' points to evaluate.
Parameters Parameters
---------- ----------
n : int n : int
The number of points to choose. The number of points to choose.
add_data : bool, default: True tell_pending : bool, default: True
If True, add the chosen points to this If True, add the chosen points to this
learner's 'data' with 'None' for the 'y' learner's 'data' with 'None' for the 'y'
values. Set this to False if you do not values. Set this to False if you do not
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment