I am getting error in the model function. I find that the dimension of image in X_train is 1 (X_train[0].ndim=1). Is that correct?
Getting the following error
It looks like your w is the wrong shape: it is 7 x 1, but it needs to be 4 x 1 in order to match the shape of X in the dot product w^T \cdot X, right? So how did that happen? Where is the shape of w determined?
I was passing X_train[0].shape[0] when initializing w. Changed it to X_train.shape[0] and it gave the correct shape for w (4,1)…
Yes, if you look at X_train[0]
, that is the first row if X_train
, which has 7 elements.