Skip to content

Instantly share code, notes, and snippets.

@shreyas90999
Last active October 5, 2020 17:23
Show Gist options
  • Save shreyas90999/aa4d22538febae98248980fa0fe76644 to your computer and use it in GitHub Desktop.
Save shreyas90999/aa4d22538febae98248980fa0fe76644 to your computer and use it in GitHub Desktop.
RMSLE error function
#RMSLE error function
def rmsle_error(y, y_pred):
assert len(y) == len(y_pred)
to_sum = [(math.log(y_pred[i] + 1) - math.log(y[i] + 1)) ** 2.0 for i,pred in enumerate(y_pred)]
return (sum(to_sum) * (1.0/len(y))) ** 0.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment