Skip to content

Instantly share code, notes, and snippets.

@WillKoehrsen
Created May 16, 2018 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WillKoehrsen/b4919a2420f3e750a62a5d6da80c735b to your computer and use it in GitHub Desktop.
Save WillKoehrsen/b4919a2420f3e750a62a5d6da80c735b to your computer and use it in GitHub Desktop.
# Function to calculate mean absolute error
def mae(y_true, y_pred):
return np.mean(abs(y_true - y_pred))
baseline_guess = np.median(y)
print('The baseline guess is a score of %0.2f' % baseline_guess)
print("Baseline Performance on the test set: MAE = %0.4f" % mae(y_test, baseline_guess))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment