def hingeloss(self,X,Y,W,b):
loss=0.0
loss+=0.5*np.dot(W,W.T)
m=X.shape[0]
for i in range(m):
ti=Y[i]*(np.dot(W,X[i].T)+b)
loss+=self.c*max(0,(1-ti))
return loss
i am getting the error as
‘int’ object is not subscriptable
in the line
ti=Y[i]*(np.dot(W,X[i].T)+b)
But i think the code is correct, can you please check