Note of deeplearning.ai

来源:互联网 发布:笨笨熊软件官网 编辑:程序博客网 时间:2024/06/06 03:51

1.

DataConversionWarning:
A column-vector y was passed when a 1d array was expected.
Please change the shape of y to (n_samples, ), for example using ravel().

要对预测输出y做出ravel()转换,也就是说我的y是2D的形式(shapes, 1),要把二维的形式改成1D的形式(shapes, ),,这就可以对fit输入的y_train作y_train.ravel()这样的转换

2.

np.squeeze(cost)     

makes sure cost is the dimension we expect.  E.g., turns [[17]] into 17