Question: Exercise 6 Please complete the compute _ gradient _ reg function below to modify the code below to calculate the following term m w j

Exercise 6
Please complete the compute_gradient_reg function below to modify the code below to calculate the following term
mwj, for j=0dots(n-1)
The starter code will add this term to the delJ(w,b)delw returned from compute_gradient above to get the gradient for the regularized cost function.
If you get stuck, you can check out the hints presented after the cell below to help you with the implementation.
# UNQ_C6
def compute_gradient_reg(X, y, w, b, lambda_=1):
"'"."
Computes the gradient for logistic regression with regularization
Args:
X : (ndarray Shape (m,n)) data, m examples by n features
y : (ndarray Shape (m,)) target value
w : (ndarray Shape (n),
 Exercise 6 Please complete the compute_gradient_reg function below to modify the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!