From 3265e88b1b1df4915d1ce514d11c8a52b5efc3f0 Mon Sep 17 00:00:00 2001 From: josalvmo <40672912+josalvmo@users.noreply.github.com> Date: Tue, 15 Jan 2019 15:43:13 -0600 Subject: [PATCH] Update in ep7.ipynb Updated prediction test against new var created with datatype and iterable properties --- ep7.ipynb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ep7.ipynb b/ep7.ipynb index a54bc04..b563f25 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]))", "display(0)" ] }, @@ -325,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[8]], dtype=float), as_iterable=False)", + "print(\"Predicted %d, Label: %d\" % (prediction, test_labels[8]))", "display(8)" ] },