Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

‎code/ch04/ch04.ipynb‎

Lines changed: 3 additions & 0 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /