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