
RNSLE
By:
beegie_b on
Nov 8th, 2013 | syntax:
Python | size: 0.37 KB | views:
219 | expires: Never
import numpy as np
def rmsle(h, y):
"""
Compute the Root Mean Squared Log Error for hypthesis h and targets y
Args:
h - numpy array containing predictions with shape (n_samples, n_targets)
y - numpy array containing targets with shape (n_samples, n_targets)
"""
return np.sqrt(np.square(np.log(h + 1) - np.log(y + 1)).mean())