1.對(duì)象初始化 def __init__(self,eta=0.01,n_iter=10):
2.AttributeError 'Precetron' object has no attribute 'predict'
把def net_input(self, X),def predict(self, X)移到fit的外面
2.AttributeError 'Precetron' object has no attribute 'predict'
把def net_input(self, X),def predict(self, X)移到fit的外面
AttributeError: module 'numpy' has no attribute 'zero'
in[5] 運(yùn)行后,報(bào)錯(cuò):
----> 2 ppn.fit(X,y)
---> 45 update=self.eta*(target-self.predict(xi))
46
47 """
AttributeError: 'Perceptron' object has no attribute 'predict'
----> 2 ppn.fit(X,y)
---> 45 update=self.eta*(target-self.predict(xi))
46
47 """
AttributeError: 'Perceptron' object has no attribute 'predict'
難道就只有我覺得 講的不夠細(xì)致?。。。。
圖標(biāo)的label里中文可能會(huì)亂碼,可以用plt.xlabel(u'花瓣長度',fontproperties='SimHei') 解決
2017-07-09
差錯(cuò)值=學(xué)習(xí)率 *(結(jié)果差2/-2/0)*輸入數(shù)據(jù)X(i)
更新的權(quán)重=權(quán)重+差錯(cuò)值 (趨向于相等)
更新的權(quán)重=權(quán)重+差錯(cuò)值 (趨向于相等)
2017-07-09