# UNQ_C2 # GRADED FUNCTION: compute_cost - AssertionError

Hello People,
I am getting an assertion error in the above-stated exercise. The screenshot and code grid is attached below. Seeking help for the resolution.

UNQ_C2

GRADED FUNCTION: compute_cost

def compute_cost(X, y, w, b, lambda_= 1):
“”"
Computes the cost over all examples
Args:
X : (ndarray Shape (m,n)) data, m examples by n features
y : (array_like Shape (m,)) target value
w : (array_like Shape (n,)) Values of parameters of the model
b : scalar Values of bias parameter of the model
lambda_: unused placeholder
Returns:
total_cost: (scalar) cost
“”"
{mentor edit: code removed}

Please do not post your code on the forum. That’s not allowed by the Community Standards.
I’m going to remove the code for you.

The compute_cost() function should not include regularization. Note that the lambda parameter says “unused placeholder”. And regularization doesn’t appear in the instructions just above this function.

Only include regularization in the compute_cost_reg() function, later in the notebook.

1 Like

@TMosh : Thank you for letting me know and clarifying my doubt.
The concern is dully noted!