the Following program:
X=np.array([[1,-7,8],[6,4,9],[7,8,9]],dtype=np.int8)
Y=np.array([1,-1,1],dtype=np.int8)
w=2
sigma=20
for i in range (len(X)):
e_i=Y-np.dot(w,X)
Ls_w=1/len(X)*(np.sum(Y-np.dot(w,X)))**2
delta_ls=-1/len(X)*np.sum(2*np.dot(X,e_i))
while delta_ls>sigma:
if(e_i != 0):
w+=2*np.dot(e_i,X)
print(w,e_i)
it gives me this : if(e_i != 0): ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
How to fix it ?