笔记内容都是记录对我有意义的方面,供我以后个人复习参考,打扰大家,还望海涵。
启动jupyter notebook的步骤,参考https://blog.csdn.net/xiewenrui1996/article/details/89765138:
1.打开Anaconda prompt
2.输入jupyter notebook 你的文件夹的位置
在运行Visualize the dataset using matplotlib 这部分代码时,发生了以下错误:
# Visualize the data:
plt.scatter(X[0, :], X[1, :], c=Y, s=40, cmap=plt.cm.Spectral);
ValueError: 'c' argument has 1 elements, which is not acceptable for use with 'x' with size 400, 'y' with size 400.
搜索发现解决办法,由于plt.scatter函数进行了改版,所以参数也发生的变动,参考该篇文章和文章下的评论:
将代码其中修改为:c=np.squeeze(Y)
# Visualize the data:
plt.scatter(X[0, :], X[1, :], c=np.squeeze(Y),