HW3: Question 1.3

HW3: Question 1.3

by Faten Ghali -
Number of replies: 1

Hi,

I have a problem with question 1.3. I chose random values for w and max_epochs but after running the cell I end up with this error. It seems to be a type-mismatching kind of error but I don't understand its origin. 


Thanks in advance for your help.

-Faten

In reply to Faten Ghali

Re: HW3: Question 1.3

by Jan Bednarík -

Are you sure that your x is a 2D array of shape (N, 2) or (N, 3)? It seems that after taking a dot product of and x you are getting a scalar, which would imply that your x is actually just a 1D vector. The error message basically says that you cannot index a scalar (where numpy.float64 is a data type of this scalar).


EDIT: In general, x does not have to be a 2D array in the predict() function, but your current implementation will only work if it is.