Python 当我尝试反向缩放预测数据时面临问题
当我使用Python 当我尝试反向缩放预测数据时面临问题,python,machine-learning,inverse-transform,Python,Machine Learning,Inverse Transform,当我使用 scale = StandardScaler() y_pred = scale.inverse_transform(y_pred) y_pred 我犯了这样的错误_ --------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipyth
scale = StandardScaler()
y_pred = scale.inverse_transform(y_pred)
y_pred
我犯了这样的错误_
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-39-07677aad64e3> in <module>()
----> 1 y_pred = scale.inverse_transform(y_pred)
/usr/local/lib/python3.6/dist-packages/sklearn/preprocessing/_data.py in inverse_transform(self, X, copy)
844 X = X.copy()
845 if self.with_std:
--> 846 X *= self.scale_
847 if self.with_mean:
848 X += self.mean_
ValueError: non-broadcastable output operand with shape (462,1) doesn't match the broadcast shape (462,4)
---------------------------------------------------------------------------
ValueError回溯(最近一次调用上次)
在()
---->1 y_pred=比例逆变换(y_pred)
/usr/local/lib/python3.6/dist-packages/sklearn/preprocessing//u data.py反变换(self,X,copy)
844 X=X.copy()
845如果自身带有标准:
-->846 X*=自刻度_
847如果自我,则表示:
848 X+=自身平均值_
ValueError:形状为(462,1)的不可广播输出操作数与广播形状(462,4)不匹配
请告诉我如何解决这个问题