mirror of
https://github.com/ArthurDanjou/handson-ml3.git
synced 2026-01-14 12:14:36 +01:00
Replace .format with f-strings
This commit is contained in:
@@ -2259,10 +2259,9 @@
|
||||
" return email\n",
|
||||
" payload = email.get_payload()\n",
|
||||
" if isinstance(payload, list):\n",
|
||||
" return \"multipart({})\".format(\", \".join([\n",
|
||||
" get_email_structure(sub_email)\n",
|
||||
" for sub_email in payload\n",
|
||||
" ]))\n",
|
||||
" multipart = \", \".join([get_email_structure(sub_email)\n",
|
||||
" for sub_email in payload])\n",
|
||||
" return f\"multipart({multipart})\"\n",
|
||||
" else:\n",
|
||||
" return email.get_content_type()"
|
||||
]
|
||||
@@ -2742,8 +2741,8 @@
|
||||
"\n",
|
||||
"y_pred = log_clf.predict(X_test_transformed)\n",
|
||||
"\n",
|
||||
"print(\"Precision: {:.2f}%\".format(100 * precision_score(y_test, y_pred)))\n",
|
||||
"print(\"Recall: {:.2f}%\".format(100 * recall_score(y_test, y_pred)))"
|
||||
"print(f\"Precision: {precision_score(y_test, y_pred):.2%}\")\n",
|
||||
"print(f\"Recall: {recall_score(y_test, y_pred):.2%}\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user