最贊回答 / Tuowi
用的IDE不同,代碼色彩也就不同。另外報錯的原因有以下可能:1、Python版本問題 - 可能性低2、np.zero() 這個方法是不存在的,正確的是 np.zeros()
2018-06-10
最新回答 / 慕運維2238754
plt.scatter(x[50:100,0], x[50:100,1], color='blue', marker='x', label='versicolor')color 前多了一個“)”
2018-05-22
第一段程序中應該是
class Perceptron
def __init__(self, eta = 0.01, n_iter=10):
def fit(self, X, y):
def net_input(self, X)
def predict(self, X):
這里是并列關系而不是包含
class Perceptron
def __init__(self, eta = 0.01, n_iter=10):
def fit(self, X, y):
def net_input(self, X)
def predict(self, X):
這里是并列關系而不是包含
2018-04-26
最贊回答 / 慕粉3504785
self.w_[1:]?=?update?*?xi原來是這里搞錯了,權重是用所有預測不準確行的結果和結果做差 然后乘以學習率求得。
self.w_[1:]?+=?update?*?xi
2018-04-26