Andrew Ng class2 week1:ValueError: c of shape (1, 300) not acceptable as a color sequence for x with size 300, y with size

最后一行改成这个:

plot_decision_boundary(lambda x: predict_dec(parameters, x.T), train_X, np.squeeze(train_Y))

或者

plt.scatter(X[0, :], X[1, :], c=np.squeeze(y), cmap=plt.cm.Spectral)
posted @ 2020-06-09 15:45  douzujun  阅读(265)  评论(0编辑  收藏  举报