Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def variances(hypothesis_func, param_func, xs, ys, x_val, y_preds):
- bla = np.empty([0,2])
- j_h = cost_func(hypothesis_func(xs), ys, mean(ys))
- cost_h = j_h(param_func)
- bla = np.append(bla, [cost_h], axis = 0)
- varianceProof = np.empty([0,2])
- for i in range(data):
- # berechne Kosten
- j_h0 = cost_function_h0(constant_hypothesis,x_,meanH0(x_))
- j_h1 = cost_function_h1(linear_hypothesis, x_, meanH1(x_))
- cost_h0 = j_h0(thetas[i][0])
- cost_h1 = j_h1(thetas[i][1],thetas[i][2])
- varianceProof = np.append(varianceProof,[[cost_h0,cost_h1]], axis=0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement