Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/299.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 当我尝试反向缩放预测数据时面临问题_Python_Machine Learning_Inverse Transform - Fatal编程技术网

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)不匹配
请告诉我如何解决这个问题