from numpy import* def Gri (train) : data=[] label=[] w=[0., 0.] b=O. lr=1 # lr=0. 001 for temp in train: data. append(temp[0] label. append(temp[1]) fullydi d=False while fullydid is False: NeverFinal=False for index in range(len(data)): CheckPoint=w[0]*data[index] [0]+w[1]*data[index] [1]+b if labelindex]Check? oint(=9. $dn. net/weixin 38358654 if NeverFinal is False: w= [w[O]+lr*label [index]*data[index] [0], w[1]+lr*l abel [index]*data[index][1]]b+=label [index]*lr NeverF inal=True print(' Q:',str(w[0])+' +x' +str(w[1])+' +y' +' +' +str(b)) if NeverFinal is False: fullydid=True 1 return w,