Skip to content

Commit

Permalink
Set tol=-np.infty to avoid a warning
Browse files Browse the repository at this point in the history
  • Loading branch information
ageron committed Dec 21, 2018
1 parent 9bf2d9e commit 9073996
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions 10_introduction_to_artificial_neural_networks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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]])"
Expand Down Expand Up @@ -2215,7 +2222,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.2"
"version": "3.6.6"
},
"nav_menu": {
"height": "264px",
Expand Down

0 comments on commit 9073996

Please sign in to comment.