Skip to content
This repository was archived by the owner on Aug 9, 2021. It is now read-only.
This repository was archived by the owner on Aug 9, 2021. It is now read-only.

第三章 线性回归中的小错误 #98

@sherpahu

Description

@sherpahu

theta_best = np.linalg.inv(X_b.T.dot(X_B)).dot(X_b.T).dot(y)
这一行代码应为
theta_best = np.linalg.inv(X_b.T.dot(X_b)).dot(X_b.T).dot(y)

另外, 由于之前np.random没有设置随机数种子, 所以生成的x和y本来就因人而异, 导致"我们希望最后得到的参数为 \theta_0=4,\theta_1=3 而不是 \theta_0=3.865,\theta_1=3.139 "这一句会与自己调试时必然不符, 没有必要注上译者的结果

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions