Skip to content

Commit a3f8fab

Browse files
committed
add a note about regularization strength
1 parent c34ac41 commit a3f8fab

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: code/ch04/ch04.ipynb

+3
Original file line numberDiff line numberDiff line change
@@ -2028,6 +2028,9 @@
20282028
"from sklearn.linear_model import LogisticRegression\n",
20292029
"\n",
20302030
"lr = LogisticRegression(penalty='l1', C=1.0)\n",
2031+
"# Note that C=1.0 is the default. You can increase\n",
2032+
"# or decrease it to make the regulariztion effect\n",
2033+
"# stronger or weaker, respectively.\n",
20312034
"lr.fit(X_train_std, y_train)\n",
20322035
"print('Training accuracy:', lr.score(X_train_std, y_train))\n",
20332036
"print('Test accuracy:', lr.score(X_test_std, y_test))"

0 commit comments

Comments
 (0)