Resolve "(Learner1D) add possibility to use the direct neighbors in the loss"
Compare changes
Files
2- Bas Nijholt authored
This makes the code work with any number of neighbors. Now the new triangle loss even works with nn_neigbors=0. I also added that we pass the neighbors in all loss_per_interval functions.
+ 33
− 35
@@ -15,7 +15,7 @@ from ..notebook_integration import ensure_holoviews
@@ -36,7 +36,7 @@ def uniform_loss(interval, scale, function_values):
@@ -70,13 +70,13 @@ def _loss_of_multi_interval(xs, ys):
@@ -88,9 +88,9 @@ def triangle_loss(interval, neighbours, scale, function_values):
@@ -121,6 +121,13 @@ def _get_neighbors_from_list(xs):
@@ -156,16 +163,18 @@ class Learner1D(BaseLearner):
@@ -231,14 +240,8 @@ class Learner1D(BaseLearner):
@@ -271,17 +274,12 @@ class Learner1D(BaseLearner):