
[英]Why is the output of torch.lstsq drastically different than np.linalg.lstsq?
[英]What is and How to write the design matrix in np.linalg.lstsq?
在使用 NumPy 包中的 lstsq() 函数来拟合具有线性和二次项的模型时,我无法弄清楚设计矩阵到底是什么。 虽然,我阅读了整个理论概念,但仍然感到困惑。 我的示例有一个解决方案,但我不知道如何找到另一个问题的设计矩阵。 这是数据集:
t = np.arange(3, 24, 2)
y = np.array([
22, 7, 16, 825, 839,
139, 150, 1161, 5120, 650, 3370
])
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.