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

2.一个完整的机器学习项目.md 一个变量名错了 #67

Open
OZhang opened this issue May 25, 2018 · 1 comment
Open

2.一个完整的机器学习项目.md 一个变量名错了 #67

OZhang opened this issue May 25, 2018 · 1 comment

Comments

@OZhang
Copy link

OZhang commented May 25, 2018

“使用交叉验证做更佳的评估”小节中,

def display_scores(scores):
... print("Scores:", scores)
... print("Mean:", scores.mean())
... print("Standard deviation:", scores.std())
...
display_scores(tree_rmse_scores)

最后一行的“tree_rmse_scores”应该是“rmse_scores”

@zhangchi1006
Copy link

是的,同意

from sklearn.model_selection import cross_val_score

scores = cross_val_score(tree_reg, housing_prepared, housing_labels,scoring="neg_mean_squared_error", cv=10)

tree_rmse_scores = np.sqrt(-scores) #这里把rmse_scores换成tree_rmse_scores

这样,和后面的这一段

display_scores(tree_rmse_scores)#这样就能对上了

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants