未验证 提交 191068fb 编写于 作者: Z Zhengqi Jiang 提交者: GitHub

Update 2.一个完整的机器学习项目.md

上级 6b7aca1f
......@@ -1212,7 +1212,7 @@ tree_reg.fit(housing_prepared, housing_labels)
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)
rmse_scores = np.sqrt(-scores)
tree_rmse_scores = np.sqrt(-scores)
```
> 警告:Scikit-Learn 交叉验证功能期望的是效用函数(越大越好)而不是损失函数(越低越好),因此得分函数实际上与 MSE 相反(即负值),这就是为什么前面的代码在计算平方根之前先计算`-scores`。
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册