Shape of vector theta

theta=np.zeros((n,)). will print a vector like [0 0 0 0…]
but we want [0
0
0]

why are we not reshaping the theta vector

hey @Par1hsharma ,
couldn’t understand your doubt , can you be please more brief , or share me the timestamp you are referring to in the video.

in gradient_Descent function we define theta as np.zeros((n,))
by defining theta as this we get a array of [0 0 0 …] but we want the theta vector to be displayed as following
[0
0
0
.
.]
my doubt is why are we not reshaping Theta vector to have just one column

why there is a need to reshape that , ???
its the same , it has the same shape, you can try it.

https://drive.google.com/file/d/1nYUUSUbiYF4Z8e3ASUV4JkVvn90zmTU_/view?usp=sharing
please see the screenshot

the way it is done in screenshot is correct , and that reshaping just is done for the matrix multiplication.

SO you can check that and go ahead , that thing might be changed in the next video, or as the X shape is different then it would worked.

the reshaping is not done in the code with sir is teaching. the reshaping I have done from my side. how is the matrix multiplication working in the code without reshaping in the video

a matrix multiplication of (100,5)x(5,) , will result in (100,)

and this is the same thing being done in video also , and hence it works.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.