When creating a post, please add:
-
Week # 3
-
Link to the classroom item you are referring to: N/A
-
Description
Getting the error :
TypeError Traceback (most recent call last)
in
8
9 w,b, J_history,_ = gradient_descent(X_train ,y_train, initial_w, initial_b,
—> 10 compute_cost, compute_gradient, alpha, iterations, 0)
<ipython-input-21-f8ee211aa9ea> in gradient_descent(X, y, w_in, b_in, cost_function, gradient_function, alpha, num_iters, lambda_)
74
75 # Calculate the gradient and update the parameters
---> 76 dj_db, dj_dw = gradient_function(X, y, w_in, b_in, lambda_)
77
78 # Update Parameters using w, b, alpha and gradient
TypeError: compute_gradient() takes 4 positional arguments but 5 were given
actually this error is coming when running def gradient_descent(X, y, w_in, b_in, cost_function, gradient_function, alpha, num_iters, lambda_):
when calling : gradient_function which actually passed with 4 arguments accepted but when calling from method : gradient_descent its expecting 5 argument
if any one had success and any pointer please solve the issue
Thanks ,
Muthu Selvan SR
