This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

RNSLE

By: beegie_b on Nov 8th, 2013  |  syntax: Python  |  size: 0.37 KB  |  views: 219  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import numpy as np
  2.  
  3. def rmsle(h, y):
  4.     """
  5.    Compute the Root Mean Squared Log Error for hypthesis h and targets y
  6.    
  7.    Args:
  8.        h - numpy array containing predictions with shape (n_samples, n_targets)
  9.        y - numpy array containing targets with shape (n_samples, n_targets)
  10.    """
  11.     return np.sqrt(np.square(np.log(h + 1) - np.log(y + 1)).mean())
clone this paste RAW Paste Data