I have a little problem with solving the week 2 practice lab. (Coursera | Online Courses & Credentials From Top Educators. Join for Free | Coursera). The way I tried to implement Q1 was to initialize the b and w arrays. Then calculate y_prediction using: y_pred = np.dot(w, x_train) to make sure I got them all at once. Then I summed the cost using np.sum like this: cost = np.sum((y_pred - y_train))**2.
At the end, I implemented the * 1/2*m.
The result I got was way off. Additionally, I get this error: ValueError: shapes (4,) and (97,) not aligned: 4 (dim 0) != 97 (dim 0).
I understand that it is also possible using the way the hint provides and parsing every data point in a for loop, but I discovered this way in a YouTube tutorial and wanted to implement it like this.
It is better to pay attention to the error message
ValueError: shapes (4,) and (97,) not aligned: 4 (dim 0) != 97 (dim 0).
What are you going to do with it? My suggestion is to paste and search the whole thing in Google, study a few examples Google gives you. When studying the examples, it is common to try to reproduce the errors in the examples and then solve them. If you can reproduce and solve them, you are more on top of it. After that, you could revisit the error you shared and see if you can solve it.