# week3PracticeLab-Ex2

**URL:** <https://community.deeplearning.ai/t/week3practicelab-ex2/179734>\
**Category:** Supervised ML: Regression and Classification\
**Tags:** week-module-3\
**Created:** [August 7, 2022, 6:23am UTC](https://community.deeplearning.ai/t/week3practicelab-ex2/179734 "2022-08-07T06:23:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anjalisreerekha](https://avatars.discourse-cdn.com/v4/letter/a/2bfe46/32.png) [@anjalisreerekha](https://community.deeplearning.ai/u/anjalisreerekha)\
**Post date:** [August 7, 2022, 6:23am UTC](https://community.deeplearning.ai/t/week3practicelab-ex2/179734/1 "2022-08-07T06:23:42Z")

</div>

![image](https://global.discourse-cdn.com/dlai/original/3X/7/a/7a61e4ee402d3b6baab686095ba5763506686d7a.png)

---

<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:** [August 7, 2022, 6:27am UTC](https://community.deeplearning.ai/t/week3practicelab-ex2/179734/2 "2022-08-07T06:27:45Z")

</div>

Hey @anjalisreerekha,  
Can you please DM your code for the function to me? For that, click on my name and select “Message”.

Cheers,  
Elemento

---

<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:** [August 7, 2022, 7:06am UTC](https://community.deeplearning.ai/t/week3practicelab-ex2/179734/3 "2022-08-07T07:06:42Z")

</div>

Hey @anjalisreerekha,  
Please take a close look at `z_wb_ij`. Try to print out the shapes of `X[i]` and `w`, and you will get to realise the error. It seems like you have inter-mixed vectorization with `for`-loop based approach. Also, note the addition of the bias term. You have added it `n+1` times, and it is supposed to be added only once. Try to correct your errors based on these suggestions, and if you are unable to do so, let us know, we will help you out.

Cheers,  
Elemento

---

<div class="post-metadata">

**Author:** ![anjalisreerekha](https://avatars.discourse-cdn.com/v4/letter/a/2bfe46/32.png) [@anjalisreerekha](https://community.deeplearning.ai/u/anjalisreerekha)\
**Post date:** [August 7, 2022, 9:07am UTC](https://community.deeplearning.ai/t/week3practicelab-ex2/179734/4 "2022-08-07T09:07:53Z")

</div>

Thank you so much Sir

---

<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:** [August 7, 2022, 10:23am UTC](https://community.deeplearning.ai/t/week3practicelab-ex2/179734/5 "2022-08-07T10:23:54Z")

</div>

Hey @anjalisreerekha,  
I am glad I could help.

**P.S. - No need to call me Sir, I am also a learner just like you** 🤓

Cheers,  
Elemento
