What is the dimension of w (assignment for week 2)?


when initialize w, it is set as a X.shape[0] vector - X(i) contains nx properties - so I think the parameter vector w should be nx rows * 1 column

The error shows the results from the model that I wrote do not match the correct w value, which is a scaler - shouldn’t w be a nx vector?

Thanks…

Hi @Wz111 , thanks for your question. I assume this is the assignment for week 1 of the DLS course 1 and not DLS course 2?

If that is the case, you are at exercise 8. Have a look at what is written down at exercise 7 - predict. The arguments of the predict function show the different input parameters as well as their size and data type. Does that help you out to figure out what went wrong with w?

regards Stephanus

2 Likes

Just adding on top of @sjfischer suggestions, the error you are getting is not related with the shape of w but rather with the contents of w, you can see that the failing assert is that one, the shape is checked in the previous step and there is no error.

2 Likes