Skip to content

Commit

Permalink
add a note about regularization strength
Browse files Browse the repository at this point in the history
  • Loading branch information
rasbt committed Jun 24, 2018
1 parent c34ac41 commit a3f8fab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions code/ch04/ch04.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,9 @@
"from sklearn.linear_model import LogisticRegression\n",
"\n",
"lr = LogisticRegression(penalty='l1', C=1.0)\n",
"# Note that C=1.0 is the default. You can increase\n",
"# or decrease it to make the regulariztion effect\n",
"# stronger or weaker, respectively.\n",
"lr.fit(X_train_std, y_train)\n",
"print('Training accuracy:', lr.score(X_train_std, y_train))\n",
"print('Test accuracy:', lr.score(X_test_std, y_test))"
Expand Down

0 comments on commit a3f8fab

Please sign in to comment.