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

Merge branch '101-how-should-learners-handle-data-that-is-outside-of-the-domain' into 'master'

Resolve "How should learners handle data that is outside of the domain"

Closes #101

See merge request !115
parents 318f27f7 a12d2ac6
No related branches found
No related tags found
1 merge request!115Resolve "How should learners handle data that is outside of the domain"
Pipeline #12309 passed
......@@ -251,6 +251,9 @@ class LearnerND(BaseLearner):
tri = self.tri
self.data[point] = value
if not self.inside_bounds(point):
return
if tri is not None:
simplex = self._pending_to_simplex.get(point)
if simplex is not None and not self._simplex_exists(simplex):
......@@ -263,8 +266,14 @@ class LearnerND(BaseLearner):
simplex = tuple(sorted(simplex))
return simplex in self.tri.simplices
def inside_bounds(self, point):
return all(mn <= p <= mx for p, (mn, mx) in zip(point, self.bounds))
def tell_pending(self, point, *, simplex=None):
point = tuple(point)
if not self.inside_bounds(point):
return
self._pending.add(point)
if self.tri is None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment