From fc6fd7e610cef41686cad7f1ec331f5b3f657308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Geron?= Date: Fri, 17 Feb 2017 14:47:18 +0100 Subject: [PATCH] Versicolor instead of Versicolour --- 04_training_linear_models.ipynb | 2 +- 05_support_vector_machines.ipynb | 10 +++++----- 06_decision_trees.ipynb | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/04_training_linear_models.ipynb b/04_training_linear_models.ipynb index 777c8f4..b9bc7b2 100644 --- a/04_training_linear_models.ipynb +++ b/04_training_linear_models.ipynb @@ -1245,7 +1245,7 @@ "\n", "plt.figure(figsize=(10, 4))\n", "plt.plot(X[y==2, 0], X[y==2, 1], \"g^\", label=\"Iris-Virginica\")\n", - "plt.plot(X[y==1, 0], X[y==1, 1], \"bs\", label=\"Iris-Versicolour\")\n", + "plt.plot(X[y==1, 0], X[y==1, 1], \"bs\", label=\"Iris-Versicolor\")\n", "plt.plot(X[y==0, 0], X[y==0, 1], \"yo\", label=\"Iris-Setosa\")\n", "\n", "from matplotlib.colors import ListedColormap\n", diff --git a/05_support_vector_machines.ipynb b/05_support_vector_machines.ipynb index e76258b..ef8ae75 100644 --- a/05_support_vector_machines.ipynb +++ b/05_support_vector_machines.ipynb @@ -100,9 +100,9 @@ "X = iris[\"data\"][:, (2, 3)] # petal length, petal width\n", "y = iris[\"target\"]\n", "\n", - "setosa_or_versicolour = (y == 0) | (y == 1)\n", - "X = X[setosa_or_versicolour]\n", - "y = y[setosa_or_versicolour]\n", + "setosa_or_versicolor = (y == 0) | (y == 1)\n", + "X = X[setosa_or_versicolor]\n", + "y = y[setosa_or_versicolor]\n", "\n", "# SVM Classifier model\n", "svm_clf = SVC(kernel=\"linear\", C=float(\"inf\"))\n", @@ -150,7 +150,7 @@ "plt.plot(x0, pred_1, \"g--\", linewidth=2)\n", "plt.plot(x0, pred_2, \"m-\", linewidth=2)\n", "plt.plot(x0, pred_3, \"r-\", linewidth=2)\n", - "plt.plot(X[:, 0][y==1], X[:, 1][y==1], \"bs\", label=\"Iris-Versicolour\")\n", + "plt.plot(X[:, 0][y==1], X[:, 1][y==1], \"bs\", label=\"Iris-Versicolor\")\n", "plt.plot(X[:, 0][y==0], X[:, 1][y==0], \"yo\", label=\"Iris-Setosa\")\n", "plt.xlabel(\"Petal length\", fontsize=14)\n", "plt.ylabel(\"Petal width\", fontsize=14)\n", @@ -373,7 +373,7 @@ "plt.figure(figsize=(12,3.2))\n", "plt.subplot(121)\n", "plt.plot(X[:, 0][y==1], X[:, 1][y==1], \"g^\", label=\"Iris-Virginica\")\n", - "plt.plot(X[:, 0][y==0], X[:, 1][y==0], \"bs\", label=\"Iris-Versicolour\")\n", + "plt.plot(X[:, 0][y==0], X[:, 1][y==0], \"bs\", label=\"Iris-Versicolor\")\n", "plot_svc_decision_boundary(svm_clf1, 4, 6)\n", "plt.xlabel(\"Petal length\", fontsize=14)\n", "plt.ylabel(\"Petal width\", fontsize=14)\n", diff --git a/06_decision_trees.ipynb b/06_decision_trees.ipynb index a152c93..2178678 100644 --- a/06_decision_trees.ipynb +++ b/06_decision_trees.ipynb @@ -159,7 +159,7 @@ " plt.contour(x1, x2, y_pred, cmap=custom_cmap2, alpha=0.8)\n", " if plot_training:\n", " plt.plot(X[:, 0][y==0], X[:, 1][y==0], \"yo\", label=\"Iris-Setosa\")\n", - " plt.plot(X[:, 0][y==1], X[:, 1][y==1], \"bs\", label=\"Iris-Versicolour\")\n", + " plt.plot(X[:, 0][y==1], X[:, 1][y==1], \"bs\", label=\"Iris-Versicolor\")\n", " plt.plot(X[:, 0][y==2], X[:, 1][y==2], \"g^\", label=\"Iris-Virginica\")\n", " plt.axis(axes)\n", " if iris:\n", @@ -241,7 +241,7 @@ }, "outputs": [], "source": [ - "X[(X[:, 1]==X[:, 1][y==1].max()) & (y==1)] # widest Iris-Versicolour flower" + "X[(X[:, 1]==X[:, 1][y==1].max()) & (y==1)] # widest Iris-Versicolor flower" ] }, { @@ -254,9 +254,9 @@ }, "outputs": [], "source": [ - "not_widest_versicolour = (X[:, 1]!=1.8) | (y==2)\n", - "X_tweaked = X[not_widest_versicolour]\n", - "y_tweaked = y[not_widest_versicolour]\n", + "not_widest_versicolor = (X[:, 1]!=1.8) | (y==2)\n", + "X_tweaked = X[not_widest_versicolor]\n", + "y_tweaked = y[not_widest_versicolor]\n", "\n", "tree_clf_tweaked = DecisionTreeClassifier(max_depth=2, random_state=40)\n", "tree_clf_tweaked.fit(X_tweaked, y_tweaked)"