Skip to content

Instantly share code, notes, and snippets.

@smazzanti
Created April 8, 2020 21:52
Show Gist options
  • Save smazzanti/2322c43cf9a656326a60c13506269a8d to your computer and use it in GitHub Desktop.
Save smazzanti/2322c43cf9a656326a60c13506269a8d to your computer and use it in GitHub Desktop.
# define a sklearn compatible wrapper for our data generating function
class UnbeatableRegressor():
def __init__(self):
pass
def fit(self, X, y):
pass
def predict(self, X):
return np.array(X2y(X, with_error = False))
def score(self, X, y):
return mean_absolute_error(y, self.predict(X))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment