【问题标题】:Multilinear Regression using OLS in Python not working with my own data [duplicate]在 Python 中使用 OLS 的多线性回归不适用于我自己的数据 [重复]
【发布时间】:2011-11-19 18:16:30
【问题描述】:

可能重复:
Python Multiple Linear Regression using OLS code with specific data?

好的,我正在使用来自 scipy.org 的 ols.py。当我输入自己的变量并尝试启动多线性回归时,我遇到了错误。

每次我尝试用我的变量代替 ols.py 附带的随机变量时,都会出现错误。

为了更好地了解我的错误,我将代码粘贴到:http://pastebin.com/PGZvEUWn

在这一行发现错误:

m = ols(y, x, y_varnm = 'y',x_varnm = ['x1','x2','x3'])

错误在写:

TypeError: this constructor takes no arguments

任何帮助都会很棒。谢谢!

【问题讨论】:

    标签: python statistics scipy regression


    【解决方案1】:

    除了类方法的缩进之外,代码是正确的。

    【讨论】:

      猜你喜欢
      • 2011-11-19
      • 1970-01-01
      • 1970-01-01
      • 2015-12-12
      • 2014-02-09
      • 2023-03-06
      • 2016-05-03
      • 1970-01-01
      • 2021-08-12
      相关资源
      最近更新 更多