Skip to content

Commit c1bec0c

Browse files
author
Dan Bright
authored
Make code more explicit
- Add explicit code to show the plotted value array for the single prediction. - Add explicit code to print the prediction label value for the single prediction.
1 parent 34fe946 commit c1bec0c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

site/en/tutorials/keras/basic_classification.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,8 @@
950950
"cell_type": "code",
951951
"source": [
952952
"plot_value_array(0, predictions_single, test_labels)\n",
953-
"_ = plt.xticks(range(10), class_names, rotation=45)"
953+
"_ = plt.xticks(range(10), class_names, rotation=45)",
954+
"plt.show()"
954955
],
955956
"execution_count": 0,
956957
"outputs": []
@@ -973,7 +974,8 @@
973974
},
974975
"cell_type": "code",
975976
"source": [
976-
"np.argmax(predictions_single[0])"
977+
"prediction_result = np.argmax(predictions_single[0])",
978+
"print(prediction_result)"
977979
],
978980
"execution_count": 0,
979981
"outputs": []

0 commit comments

Comments
 (0)