Advertisement
Guest User

Untitled

a guest
Dec 10th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. def variances(hypothesis_func, param_func, xs, ys, x_val, y_preds):
  2. bla = np.empty([0,2])
  3. j_h = cost_func(hypothesis_func(xs), ys, mean(ys))
  4. cost_h = j_h(param_func)
  5. bla = np.append(bla, [cost_h], axis = 0)
  6.  
  7.  
  8. varianceProof = np.empty([0,2])
  9. for i in range(data):
  10. # berechne Kosten
  11. j_h0 = cost_function_h0(constant_hypothesis,x_,meanH0(x_))
  12. j_h1 = cost_function_h1(linear_hypothesis, x_, meanH1(x_))
  13. cost_h0 = j_h0(thetas[i][0])
  14. cost_h1 = j_h1(thetas[i][1],thetas[i][2])
  15. varianceProof = np.append(varianceProof,[[cost_h0,cost_h1]], axis=0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement