daily pastebin goal
34%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def exact_linear_reg_solution(X, y, C=0):
  2.     return np.linalg.inv(X.T.dot(X) + C * np.identity(n=X.shape[1])).dot(X.T).dot(y)
  3.  
  4. def linear_reg_loss(X, y, w, C=0):
  5.     return np.linalg.norm(X.dot(w) - y) ** 2 + C * (np.linalg.norm(w) ** 2)
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