我有一个数据集,包含2个特征(价格和成交量)和1个预测变量(价格),并使用LTSM模型根据先前的价格数据来预测下一个价格。
首先,我对数据集进行缩放处理:
#Scale the data
scaler = MinMaxScaler(feature_range=(0,1))
scaled_data = scaler.fit_transform(dataset)
最后我想将其还原为原始状态:
#Get the models predicted price values
predictions = model.predict(x_test)
predictions = scaler.inverse_transform(predictions)
但是这样做不起作用,我得到了这个错误:
ValueError: non-broadcastable output operand with shape (400,1) doesn't match the broadcast shape (400,2)