部分资料来源于网络,仅做个人学习之用
吴恩达课后作业整合
https://blog.youkuaiyun.com/u013733326/article/details/79827273
问题集合
课程1_第3周_编程作业
(1)
# 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(X[0, :], X[1, :], c=squeeze(Y), s=40, cmap=plt.cm.Spectral);
(2)
# Plot the decision boundary for logistic regression
plot_decision_boundary(lambda x: clf.predict(x), X, Y)
报错: ValueError: RGBA sequence should have length 3 or 4 During handli