# C1 W3 assignment error

**URL:** <https://community.deeplearning.ai/t/c1-w3-assignment-error/142265>\
**Category:** Supervised ML: Regression and Classification\
**Tags:** week-module-3\
**Created:** [June 19, 2022, 2:14am UTC](https://community.deeplearning.ai/t/c1-w3-assignment-error/142265 "2022-06-19T02:14:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sonubedi](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@sonubedi](https://community.deeplearning.ai/u/sonubedi)\
**Post date:** [June 19, 2022, 2:14am UTC](https://community.deeplearning.ai/t/c1-w3-assignment-error/142265/1 "2022-06-19T02:14:47Z")

</div>

Hello,

I am getting error while executing unit test function compute\_cost\_test(compute\_cost). It is giving below error.

AssertionError: Wrong output. Expected: 2.15510667 got: 2.75932426268233

Also, output of compute\_cost is coming as 0.218 while expected output is 0.219

Its strange that compute\_cost function is working well for me with Cost at initial w (zeros): 0.693

This notebook may have other issues as I was reading another post where it was mentioned that err variable was not needed there.

---

<div class="post-metadata">

**Author:** ![Agoose](https://avatars.discourse-cdn.com/v4/letter/a/fbc32d/32.png) [@Agoose](https://community.deeplearning.ai/u/Agoose)\
**Post date:** [June 19, 2022, 3:00am UTC](https://community.deeplearning.ai/t/c1-w3-assignment-error/142265/2 "2022-06-19T03:00:00Z")

</div>

![Screen Shot 2022-06-19 at 12.58.55](https://global.discourse-cdn.com/dlai/original/3X/b/c/bcd0c0e73ecc516986e504f0948d8a6f13242c62.png)

The expected output for me is 0.218

---

<div class="post-metadata">

**Author:** ![sonubedi](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@sonubedi](https://community.deeplearning.ai/u/sonubedi)\
**Post date:** [June 19, 2022, 3:51am UTC](https://community.deeplearning.ai/t/c1-w3-assignment-error/142265/3 "2022-06-19T03:51:16Z")

</div>

![image](https://global.discourse-cdn.com/dlai/original/3X/0/3/03a7377b17f9476099e6b42a54b73f78af27c237.png)

Here is my screenshot.

---

<div class="post-metadata">

**Author:** ![Agoose](https://avatars.discourse-cdn.com/v4/letter/a/fbc32d/32.png) [@Agoose](https://community.deeplearning.ai/u/Agoose)\
**Post date:** [June 19, 2022, 4:59am UTC](https://community.deeplearning.ai/t/c1-w3-assignment-error/142265/4 "2022-06-19T04:59:29Z")

</div>

I’ve no clue. But you can check the solutions in the Lab Files (top right) to compare as well as the hints.

But yeah, the course is really new. As of right now the 3rd course of this ML specialisation, on Unsupervised Learning hasn’t been uploaded yet so there are bound to be some errors – re: typos and other weird little artifacts

---

<div class="post-metadata">

**Author:** ![Elemento](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/elemento/32/854_2.png) [@Elemento](https://community.deeplearning.ai/u/Elemento)\
**Post date:** [June 19, 2022, 6:03am UTC](https://community.deeplearning.ai/t/c1-w3-assignment-error/142265/5 "2022-06-19T06:03:41Z")

</div>

Hey @sonubedi,  
Welcome to the community. Can you please DM your notebook to me? For that, you may click on my name and select **Message**.

Regards,  
Elemento

---

<div class="post-metadata">

**Author:** ![sonubedi](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@sonubedi](https://community.deeplearning.ai/u/sonubedi)\
**Post date:** [June 19, 2022, 4:08pm UTC](https://community.deeplearning.ai/t/c1-w3-assignment-error/142265/7 "2022-06-19T16:08:37Z")

</div>

Kindly ignore this issue. I was using regularized term unnecessarily. There was lambda parameter given in the function definition which caused confusion.

---

<div class="post-metadata">

**Author:** ![Elemento](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/elemento/32/854_2.png) [@Elemento](https://community.deeplearning.ai/u/Elemento)\
**Post date:** [June 19, 2022, 5:15pm UTC](https://community.deeplearning.ai/t/c1-w3-assignment-error/142265/8 "2022-06-19T17:15:11Z")

</div>

Hey @sonubedi,  
Thanks for confirming that you have been able to solve the issue by yourself.

Regards,  
Elemento
