我需要帮助利用Numpy通过Python进行线性回归确定两个自变量和一个因变量。我在下面找到了这段代码片段,用于查找我认为来自 http://rosettacode.org/wiki/Multiple_regression#Python 的r ^ 2值
import numpy as np
height = [1.47, 1.50, 1.52, 1.55, 1.57, 1.60, 1.63,
1.65, 1.68, 1.70, 1.73, 1.75, 1.78, 1.80, 1.83]
weight = [52.21, 53.12, 54.48, 55.84, 57.20, 58.57, 59.93,
61.29, 63.11, 64.47, 66.28, 68.10, 69.92, 72.19, 74.46]
X = np.array(height)[:, None]**range(3)
y = (weight)
print(np.linalg.lstsq(X, y)[0])
如何编辑它来确定两个自变量和一个因变量的r ^ 2值?感谢