From 325fb2b9d4f1b272214e783fdeeb08dfa611bc15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Geron?= Date: Fri, 21 Dec 2018 11:53:42 +0800 Subject: [PATCH] Set tol=-np.infty to avoid a warning --- 10_introduction_to_artificial_neural_networks.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/10_introduction_to_artificial_neural_networks.ipynb b/10_introduction_to_artificial_neural_networks.ipynb index ce625c5..6df82f8 100644 --- a/10_introduction_to_artificial_neural_networks.ipynb +++ b/10_introduction_to_artificial_neural_networks.ipynb @@ -74,6 +74,13 @@ "# Perceptrons" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Note**: we set `max_iter` and `tol` explicitly to avoid warnings about the fact that their default value will change in future versions of Scikit-Learn." + ] + }, { "cell_type": "code", "execution_count": 2, @@ -88,7 +95,7 @@ "X = iris.data[:, (2, 3)] # petal length, petal width\n", "y = (iris.target == 0).astype(np.int)\n", "\n", - "per_clf = Perceptron(max_iter=100, random_state=42)\n", + "per_clf = Perceptron(max_iter=100, tol=-np.infty, random_state=42)\n", "per_clf.fit(X, y)\n", "\n", "y_pred = per_clf.predict([[2, 0.5]])" @@ -968,7 +975,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.5.2" + "version": "3.6.6" }, "nav_menu": { "height": "264px",