Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions ep7.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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)\n",
"print (\"Predicted %d, Label: %d\" % (prediction, test_labels[0]))\n",
"display(0)"
]
},
Expand Down Expand Up @@ -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[0]], dtype=float), as_iterable=False)\n",
"print (\"Predicted %d, Label: %d\" % (prediction, test_labels[8]))\n",
"display(8)"
]
},
Expand Down Expand Up @@ -358,7 +360,7 @@
}
],
"source": [
"weights = classifier.weights_\n",
"weights = classifier.get_variable_value(\"linear//weight\")\n",
"f, axes = plt.subplots(2, 5, figsize=(10,4))\n",
"axes = axes.reshape(-1)\n",
"for i in range(len(axes)):\n",
Expand Down