# C2\_W3 lab 1 regression part W=(n\_y,1)

**URL:** <https://community.deeplearning.ai/t/c2-w3-lab-1-regression-part-w-n-y-1/705434>\
**Category:** Calculus for Machine Learning and Data Science\
**Tags:** week-module-3\
**Created:** [October 8, 2024, 9:37pm UTC](https://community.deeplearning.ai/t/c2-w3-lab-1-regression-part-w-n-y-1/705434 "2024-10-08T21:37:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ninadmehta34](https://avatars.discourse-cdn.com/v4/letter/n/e56c9b/32.png) [@ninadmehta34](https://community.deeplearning.ai/u/ninadmehta34)\
**Post date:** [October 8, 2024, 9:37pm UTC](https://community.deeplearning.ai/t/c2-w3-lab-1-regression-part-w-n-y-1/705434/1 "2024-10-08T21:37:41Z")

</div>

we already know n\_x & n\_y = 1. when we try initiating the parameters, W = np.random.randn(n\_y,n\_x); why is the order n\_y,n\_x? and not the other way around or simply (1,1) ? does it matter given we are using a random number generator?

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [October 8, 2024, 10:14pm UTC](https://community.deeplearning.ai/t/c2-w3-lab-1-regression-part-w-n-y-1/705434/2 "2024-10-08T22:14:19Z")

</div>

You want your code to work with any set of data, so that’s why you don’t hard-code the dimensions.

The convention is to use n\_y for the rows and n\_x for the columns. It’s not a universal standard, so you’ll find both methods.

---

<div class="post-metadata">

**Author:** ![ninadmehta34](https://avatars.discourse-cdn.com/v4/letter/n/e56c9b/32.png) [@ninadmehta34](https://community.deeplearning.ai/u/ninadmehta34)\
**Post date:** [October 11, 2024, 7:21am UTC](https://community.deeplearning.ai/t/c2-w3-lab-1-regression-part-w-n-y-1/705434/3 "2024-10-11T07:21:08Z")

</div>

Ok. thank you, Tom
