我之前使用StandardScaler来标准化我的时间序列数据,然后将其输入到RNN中。这一直运作良好。但现在我改用了MinMaxScaler。除了无法将数据逆变换回来之外,一切正常。
尝试逆变换时,我得到了以下错误:
ValueError: Expected 2D array, got 1D array instead:array=[0.03481037].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.
回答:
错误明确指出你的输入是一维的。因此,尝试使用reshape函数将其改为二维。