线性回归问题中的值预测

huangapple go评论46阅读模式
英文:

Linear Regression problem in predicting values

问题

我正在尝试使用线性回归来预测数值。当我使用以下代码时:

reg.predict(60)

会出现如下错误:

错误

如何解决这个问题?

英文:

I am trying to predict values using linear regression . when I use Here

reg.predict(60)

it pops like this error

How to reshape this?

答案1

得分: 1

预测函数接受一个二维数组作为输入,所以您可以使用 reg.predict([[60]]) 代替。

英文:

The prediction function takes a 2-D array as an input, so you can use reg.predict([[60]]) instead

huangapple
  • 本文由 发表于 2023年2月19日 11:39:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/75497833.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定