输入包含NAN,INFINITY或一个太大的值(float64')linearregress:但是没有空值
最初,我的输入数据集有空格。但是我已经清理了它,并检查了: df.isnull()。sum() 而且一切都是0。 现在,将我的数据集拟合到线性重试模型并要进行预测之后,它带来了上述错误。
Originally, my input dataset had blank spaces. But I have cleaned it, and checked with:
df.isnull().sum()
And everthing is 0.
Now, after fitting my dataset into the LinearRegression model and about to make predictions, it's bringing the above error.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于您确实提到了在预测时间内发生的错误,因此我建议您使测试数据通过与培训数据相同的管道。
例如:
原始培训输入 - >预处理 - >训练输入
是必要的,测试数据也经过相同的预处理。
Since you did mention that the error is happening during the prediction time, I would suggest that you make the testing data go through the same pipeline as the training data.
For example:
raw training input -> preprocessing -> training input
It is necessary the test data also goes through the same preprocessing.