From 02c9887e63955683c4346d5bd908cf6236ee1005 Mon Sep 17 00:00:00 2001 From: Nick Graham Date: Mon, 22 Jan 2018 14:33:22 -0600 Subject: [PATCH 1/2] Fixes precision / recall percent notation 0.95 = 95% 0.95% = 0.0095 --- 03_classification.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/03_classification.ipynb b/03_classification.ipynb index 2c15e20..e544fc3 100644 --- a/03_classification.ipynb +++ b/03_classification.ipynb @@ -4659,8 +4659,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "Precision: 0.95%\n", - "Recall: 0.98%\n" + "Precision: 95%\n", + "Recall: 98%\n" ] } ], @@ -4674,8 +4674,8 @@ "\n", "y_pred = log_clf.predict(X_test_transformed)\n", "\n", - "print(\"Precision: {:.2f}%\".format(precision_score(y_test, y_pred)))\n", - "print(\"Recall: {:.2f}%\".format(recall_score(y_test, y_pred)))" + "print(\"Precision: {:.2f}%\".format(100 * precision_score(y_test, y_pred)))\n", + "print(\"Recall: {:.2f}%\".format(100 * recall_score(y_test, y_pred)))" ] } ], From a52cd6d1bd71e980843e2e5c90cad76e13ef254b Mon Sep 17 00:00:00 2001 From: Nick Graham Date: Mon, 22 Jan 2018 14:39:02 -0600 Subject: [PATCH 2/2] Fixes output to match source {:.2f} will give two decimal places --- 03_classification.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/03_classification.ipynb b/03_classification.ipynb index e544fc3..ae1853d 100644 --- a/03_classification.ipynb +++ b/03_classification.ipynb @@ -4659,8 +4659,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "Precision: 95%\n", - "Recall: 98%\n" + "Precision: 95.00%\n", + "Recall: 98.00%\n" ] } ],