Skip to content

Commit

Permalink
Added predict to BaseFunction
Browse files Browse the repository at this point in the history
Added predict to the BaseFunction class to better
enable compatability with scikit learn.

Based on a suggestion from luk-f-a in #28.
  • Loading branch information
jeffrey-hokanson committed Oct 2, 2019
1 parent b38c31e commit 07faf5f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions psdr/function.py
Expand Up @@ -35,6 +35,11 @@ def __call__(self, X, return_grad = False, **kwargs):
else:
return self.eval(X, **kwargs)

def predict(self, X):
r""" Alias of __call__ to match scikit learn API
"""
return self.__call__(X)


class Function(BaseFunction):
r"""Wrapper around function specifying the domain
Expand Down

0 comments on commit 07faf5f

Please sign in to comment.