未验证 提交 1f64a587 编写于 作者: Y Yu Wang 提交者: GitHub

订正 4.训练模型.md 代码中的缩进和括号配对问题

上级 894b406d
......@@ -413,8 +413,8 @@ def plot_learning_curves(model, X, y):
y_val_predict = model.predict(X_val)
train_errors.append(mean_squared_error(y_train_predict, y_train[:m]))
val_errors.append(mean_squared_error(y_val_predict, y_val))
plt.plot(np.sqrt(train_errors), "r-+", linewidth=2, label="train")
plt.plot(np.sqrt(val_errors), "b-", linewidth=3, label="val")
plt.plot(np.sqrt(train_errors), "r-+", linewidth=2, label="train")
plt.plot(np.sqrt(val_errors), "b-", linewidth=3, label="val")
```
我们一起看一下简单线性回归模型的学习曲线(图 4-15):
......@@ -714,7 +714,7 @@ log_reg.fit(X, y)
X_new = np.linspace(0, 3, 1000).reshape(-1, 1)
y_proba = log_reg.predict_proba(X_new)
plt.plot(X_new, y_proba[:, 1], "g-", label="Iris-Virginica")
plt.plot(X_new, y_proba[:, 0], "b--", label="Not Iris-Virginica"
plt.plot(X_new, y_proba[:, 0], "b--", label="Not Iris-Virginica")
```
![](../images/chapter_4/图4-23.PNG)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册