SHARE
TWEET

Untitled

a guest Jul 18th, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import numpy as np
  2. x = [1,2,3]
  3. y = [0,0,1]
  4.  
  5. def mse(target_y, predicted_y):
  6.     diff = np.array(target_y) - np.array(predicted_y) #diff = [1, 2, 2]
  7.     square = diff ** 2 # square = [1, 4, 4]
  8.     summation = sum(square) # summation = 9
  9.     return summation / len(x) #3
  10.    
  11. mse(x,y)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top