diff --git a/03_classification.ipynb b/03_classification.ipynb index f2dfa63..4a91f34 100644 --- a/03_classification.ipynb +++ b/03_classification.ipynb @@ -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%}\")" ] }, {