1.對象初始化 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的外面
2017-07-21
AttributeError: module 'numpy' has no attribute 'zero'
2017-07-20
in[5] 運行后,報錯:
----> 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'
2017-07-19
圖標的label里中文可能會亂碼,可以用plt.xlabel(u'花瓣長度',fontproperties='SimHei') 解決
2017-07-09