【发布时间】:2019-07-29 04:50:18
【问题描述】:
我不知道为什么会出现错误,我尝试过重塑但没有运气。
感谢您的回答。
X_test = np.append(X_test, scaler.transform(working_data.iloc[-1][0]))
这是我收到的错误消息。
ValueError: Expected 2D array, got scalar array instead:
array=9583.994119999077.
Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.
完整代码在这里:https://activewizards.com/blog/bitcoin-price-forecasting-with-deep-learning-algorithms/
非常感谢您的帮助。
【问题讨论】:
-
大概,
working_data.iloc[-1][0]是一个标量,因此需要重塑。在scaler.transform中尝试np.reshape(working_data.iloc[-1][0], (-1,1))