python机器学习-chapter2_3

•line = np.linspace(-3, 3, 1000).reshape(-1, 1)

np.linspace(-3, 3, 100)用来返回-3到3之间的100个等间距的数字,返回值是一个列表

np.linspace(): https://blog.csdn.net/u013555719/article/details/83989987

np.reshape(-1, 1)用来将数组转换为一列

np.reshape(): https://blog.csdn.net/qq_29831163/article/details/90112000#reshape(-1%2C1)%E8%BD%AC%E6%8D%A2%E6%88%901%E5%88%97%EF%BC%9A

•plot符号大全

https://blog.csdn.net/ztf312/article/details/49933497

•plt.legend(["Class 0", "Class 1"], loc = "best")

plt.legend()中loc可以直接设置为"best"

相关推荐