Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

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),
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions