1.给预测值赋值时需要对预测值集合设置大小,否则会有Index错误
predictions = np.zeros((1,A2.shape[1]))
2.编写画图plt.scatter时,python3中的c值赋值问题
c=np.squeeze( 你想现实的数据)
否则c of shape (1, 400) not acceptable的错误
numpy.squeeze(a). 从数组的形状中删除单维条目,即把shape中为1的维度去掉
x = np.array([[[0], [1], [2]]])
print(x)
"""
x=
[[[0]
[1]
[2]]]
"""
print(x.shape) # (1, 3, 1)
x1 = np.squeeze(x) # 从数组的形状中删除单维条目,即把shape中为1的维度去掉
print(x1) # [0 1 2]
print(x1.shape) # (3,)