我似乎找不到任何进行多重回归的python库.我发现的唯一的东西只做简单的回归.我需要对几个自变量(x1,x2,x3等)回归我的因变量(y).
例如,使用此数据:
print 'y x1 x2 x3 x4 x5 x6 x7'
for t in texts:
print "{:>7.1f}{:>10.2f}{:>9.2f}{:>9.2f}{:>10.2f}{:>7.2f}{:>7.2f}{:>9.2f}" /
.format(t.y,t.x1,t.x2,t.x3,t.x4,t.x5,t.x6,t.x7)
Run Code Online (Sandbox Code Playgroud)
(以上输出:)
y x1 x2 x3 x4 x5 x6 x7
-6.0 -4.95 -5.87 -0.76 14.73 4.02 0.20 0.45
-5.0 -4.55 -4.52 -0.71 13.74 4.47 0.16 0.50
-10.0 -10.96 -11.64 -0.98 15.49 4.18 0.19 0.53
-5.0 -1.08 -3.36 0.75 24.72 4.96 0.16 0.60
-8.0 -6.52 -7.45 -0.86 16.59 4.29 0.10 0.48
-3.0 -0.81 -2.36 -0.50 22.44 4.81 0.15 0.53
-6.0 -7.01 -7.33 -0.33 …Run Code Online (Sandbox Code Playgroud) 我正在运行ActiveState Python 3.2,并得到这个神秘的错误:
D:\code>python
ActivePython 3.2.1.2 (ActiveState Software Inc.) based on
Python 3.2.1 (default, Jul 18 2011, 14:31:09) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> x = np.array([[1, 1], [2, 1], [3, 1]])
>>> y = np.array([3, 4, 5])
>>> be = np.linalg.lstsq(x,y)
MKL ERROR: Parameter 5 was incorrect on entry to DGELSD
MKL ERROR: Parameter 5 was incorrect on entry to DGELSD
>>>
Run Code Online (Sandbox Code Playgroud)
有谁知道可能会发生什么?