Skip to content

Commit

Permalink
Merge pull request #121 from mtezzele/gpr
Browse files Browse the repository at this point in the history
add normalizer option and docs
  • Loading branch information
mtezzele committed Jul 21, 2020
2 parents 968fb96 + f993fb9 commit 6d2c3ff
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ezyrb/gpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,17 @@ def __init__(self):
self.Y_sample = None
self.model = None

def fit(self, points, values, kern=None, optimization_restart=20):
def fit(self, points, values, kern=None, normalizer=True, optimization_restart=20):
"""
Construct the regression given `points` and `values`.
:param array_like points: the coordinates of the points.
:param array_like values: the values in the points.
:param GPy.kern kern: kernel object from GPy.
:param bool normalizer: whether to normilize `values` or not.
Defaults to True.
:param int optimization_restart: number of restarts for the
optimization. Defaults to 20.
"""
self.X_sample = np.array(points)
self.Y_sample = np.array(values)
Expand All @@ -57,7 +62,7 @@ def fit(self, points, values, kern=None, optimization_restart=20):
self.X_sample,
self.Y_sample,
kern,
normalizer=True)
normalizer=normalizer)

self.model.optimize_restarts(optimization_restart, verbose=False)

Expand Down

0 comments on commit 6d2c3ff

Please sign in to comment.