From ddca55b10be8146772160f5e2cc70c452d8b5c0b Mon Sep 17 00:00:00 2001 From: Abhijeet Singh Date: Mon, 16 Jul 2018 00:33:30 +0530 Subject: [PATCH 1/2] Fix for issue #4 --- ep7.ipynb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ep7.ipynb b/ep7.ipynb index a54bc04..0e7b351 100644 --- a/ep7.ipynb +++ b/ep7.ipynb @@ -294,7 +294,8 @@ ], "source": [ "# here's one it gets right\n", - "print (\"Predicted %d, Label: %d\" % (classifier.predict(test_data[0]), test_labels[0]))\n", + "prediction = classifier.predict(np.array([test_data[0]], dtype=float), as_iterable=False)", + "print (\"Predicted %d, Label: %d\" % (prediction, test_labels[0]))\n", "display(0)" ] }, From 693f6eba3cd3c8aa959d4b41118fd17d488cc224 Mon Sep 17 00:00:00 2001 From: Abhijeet Singh Date: Mon, 16 Jul 2018 01:10:15 +0530 Subject: [PATCH 2/2] Fixed both occurrences of issue #4 --- ep7.ipynb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ep7.ipynb b/ep7.ipynb index 0e7b351..7f493cd 100644 --- a/ep7.ipynb +++ b/ep7.ipynb @@ -326,7 +326,8 @@ ], "source": [ "# and one it gets wrong\n", - "print (\"Predicted %d, Label: %d\" % (classifier.predict(test_data[8]), test_labels[8]))\n", + "prediction = classifier.predict(np.array([test_data[0]], dtype=float), as_iterable=False)", + "print (\"Predicted %d, Label: %d\" % (prediction, test_labels[8]))\n", "display(8)" ] },