--------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-24-83d76d986e7e> in <module>() ----> 1 ppn = Perceptron(eta=0.1, n_iter=10) 2 ppn.
这两个代码运行错误怎么解决,感觉完完全全按照老师打的呀
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-24-83d76d986e7e> in <module>()
----> 1 ppn = Perceptron(eta=0.1, n_iter=10)
2 ppn.fit(X,y)
3 plt.plot(range(1,len(ppn.errors_) + 1), ppn.errors_, marker='o')
4 plt.xlabel('Epochs')
5 plt.ylabel('错误分类次数')
NameError: name 'Perceptron' is not defined
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-22-6d6859494f47> in <module>()
----> 1 plot_decision_regions(X, y, ppn, resolution=0.02)
NameError: name 'ppn' is not defined